Skip to content

Commit 402644f

Browse files
committed
safe transmute: test to ensure that trait is correctly feature-gated
ref: #92268 (comment)
1 parent 4a15157 commit 402644f

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// The trait must not be available if its feature flag is absent.
2+
3+
#![crate_type = "lib"]
4+
5+
use std::mem::BikeshedIntrinsicFrom;
6+
//~^ ERROR use of unstable library feature 'transmutability' [E0658]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error[E0658]: use of unstable library feature 'transmutability'
2+
--> $DIR/feature-missing.rs:5:5
3+
|
4+
LL | use std::mem::BikeshedIntrinsicFrom;
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6+
|
7+
= help: add `#![feature(transmutability)]` to the crate attributes to enable
8+
9+
error: aborting due to previous error
10+
11+
For more information about this error, try `rustc --explain E0658`.

0 commit comments

Comments
 (0)