Skip to content

Commit b78c3da

Browse files
committed
safe transmute: reference tracking issue
ref: #92268 (comment)
1 parent 21d1ab4 commit b78c3da

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed

library/core/src/mem/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ mod valid_align;
2828
pub(crate) use valid_align::ValidAlign;
2929

3030
mod transmutability;
31-
#[unstable(feature = "transmutability", issue = "none")]
31+
#[unstable(feature = "transmutability", issue = "99571")]
3232
pub use transmutability::{Assume, BikeshedIntrinsicFrom};
3333

3434
#[stable(feature = "rust1", since = "1.0.0")]

library/core/src/mem/transmutability.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/// This trait is implemented on-the-fly by the compiler for types `Src` and `Self` when the bits of
44
/// any value of type `Self` are safely transmutable into a value of type `Dst`, in a given `Context`,
55
/// notwithstanding whatever safety checks you have asked the compiler to [`Assume`] are satisfied.
6-
#[unstable(feature = "transmutability", issue = "none")]
6+
#[unstable(feature = "transmutability", issue = "99571")]
77
#[cfg_attr(not(bootstrap), lang = "transmute_trait")]
88
#[rustc_on_unimplemented(
99
message = "`{Src}` cannot be safely transmuted into `{Self}` in the defining scope of `{Context}`.",
@@ -22,7 +22,7 @@ pub unsafe trait BikeshedIntrinsicFrom<
2222
}
2323

2424
/// What transmutation safety conditions shall the compiler assume that *you* are checking?
25-
#[unstable(feature = "transmutability", issue = "none")]
25+
#[unstable(feature = "transmutability", issue = "99571")]
2626
#[derive(PartialEq, Eq, Clone, Copy, Debug)]
2727
pub struct Assume {
2828
/// When `true`, the compiler assumes that *you* are ensuring (either dynamically or statically) that

src/test/ui/transmutability/malformed-program-gracefulness/feature-missing.rs

+3
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@
44

55
use std::mem::BikeshedIntrinsicFrom;
66
//~^ ERROR use of unstable library feature 'transmutability' [E0658]
7+
8+
use std::mem::Assume;
9+
//~^ ERROR use of unstable library feature 'transmutability' [E0658]

src/test/ui/transmutability/malformed-program-gracefulness/feature-missing.stderr

+11-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,18 @@ error[E0658]: use of unstable library feature 'transmutability'
44
LL | use std::mem::BikeshedIntrinsicFrom;
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
7+
= note: see issue #99571 <https://github.com/rust-lang/rust/issues/99571> for more information
78
= help: add `#![feature(transmutability)]` to the crate attributes to enable
89

9-
error: aborting due to previous error
10+
error[E0658]: use of unstable library feature 'transmutability'
11+
--> $DIR/feature-missing.rs:8:5
12+
|
13+
LL | use std::mem::Assume;
14+
| ^^^^^^^^^^^^^^^^
15+
|
16+
= note: see issue #99571 <https://github.com/rust-lang/rust/issues/99571> for more information
17+
= help: add `#![feature(transmutability)]` to the crate attributes to enable
18+
19+
error: aborting due to 2 previous errors
1020

1121
For more information about this error, try `rustc --explain E0658`.

0 commit comments

Comments
 (0)