]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/min_const_fn/min_const_fn_unsafe_bad.stderr
Rollup merge of #85766 - workingjubilee:file-options, r=yaahc
[rust.git] / src / test / ui / consts / min_const_fn / min_const_fn_unsafe_bad.stderr
1 error[E0658]: dereferencing raw mutable pointers in constant functions is unstable
2   --> $DIR/min_const_fn_unsafe_bad.rs:1:77
3    |
4 LL | const fn bad_const_fn_deref_raw(x: *mut usize) -> &'static usize { unsafe { &*x } }
5    |                                                                             ^^^
6    |
7    = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
8    = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
9
10 error[E0658]: dereferencing raw mutable pointers in constant functions is unstable
11   --> $DIR/min_const_fn_unsafe_bad.rs:4:70
12    |
13 LL | const unsafe fn bad_const_unsafe_deref_raw(x: *mut usize) -> usize { *x }
14    |                                                                      ^^
15    |
16    = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
17    = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
18
19 error[E0658]: dereferencing raw mutable pointers in constant functions is unstable
20   --> $DIR/min_const_fn_unsafe_bad.rs:7:83
21    |
22 LL | const unsafe fn bad_const_unsafe_deref_raw_ref(x: *mut usize) -> &'static usize { &*x }
23    |                                                                                   ^^^
24    |
25    = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
26    = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
27
28 error: aborting due to 3 previous errors
29
30 For more information about this error, try `rustc --explain E0658`.