safe transmute: test to ensure that trait is correctly feature-gated
ref: https://github.com/rust-lang/rust/pull/92268#discussion_r925265476
This commit is contained in:
parent
4a15157bad
commit
402644f72f
@ -0,0 +1,6 @@
|
|||||||
|
// The trait must not be available if its feature flag is absent.
|
||||||
|
|
||||||
|
#![crate_type = "lib"]
|
||||||
|
|
||||||
|
use std::mem::BikeshedIntrinsicFrom;
|
||||||
|
//~^ ERROR use of unstable library feature 'transmutability' [E0658]
|
@ -0,0 +1,11 @@
|
|||||||
|
error[E0658]: use of unstable library feature 'transmutability'
|
||||||
|
--> $DIR/feature-missing.rs:5:5
|
||||||
|
|
|
||||||
|
LL | use std::mem::BikeshedIntrinsicFrom;
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
|
||||||
|
= help: add `#![feature(transmutability)]` to the crate attributes to enable
|
||||||
|
|
||||||
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
For more information about this error, try `rustc --explain E0658`.
|
Loading…
Reference in New Issue
Block a user