blob: 9de0e732f33d242f9fe91791dfd6d02d629046c6 [file] [log] [blame]
error[E0658]: dereferencing raw pointers in constant functions is unstable
--> $DIR/min_const_fn_unsafe_bad.rs:1:77
|
LL | const fn bad_const_fn_deref_raw(x: *mut usize) -> &'static usize { unsafe { &*x } }
| ^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/51911
= help: add `#![feature(const_raw_ptr_deref)]` to the crate attributes to enable
error[E0658]: dereferencing raw pointers in constant functions is unstable
--> $DIR/min_const_fn_unsafe_bad.rs:4:70
|
LL | const unsafe fn bad_const_unsafe_deref_raw(x: *mut usize) -> usize { *x }
| ^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/51911
= help: add `#![feature(const_raw_ptr_deref)]` to the crate attributes to enable
error[E0658]: dereferencing raw pointers in constant functions is unstable
--> $DIR/min_const_fn_unsafe_bad.rs:7:83
|
LL | const unsafe fn bad_const_unsafe_deref_raw_ref(x: *mut usize) -> &'static usize { &*x }
| ^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/51911
= help: add `#![feature(const_raw_ptr_deref)]` to the crate attributes to enable
error[E0658]: unions in const fn are unstable
--> $DIR/min_const_fn_unsafe_bad.rs:14:5
|
LL | Foo { x: () }.y
| ^^^^^^^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/51909
= help: add `#![feature(const_fn_union)]` to the crate attributes to enable
error[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block
--> $DIR/min_const_fn_unsafe_bad.rs:1:77
|
LL | const fn bad_const_fn_deref_raw(x: *mut usize) -> &'static usize { unsafe { &*x } }
| ^^^ dereference of raw pointer
|
= note: raw pointers may be NULL, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior
error: aborting due to 5 previous errors
Some errors have detailed explanations: E0133, E0658.
For more information about an error, try `rustc --explain E0133`.