summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/min_const_fn/min_const_fn_unsafe_bad.stderr
blob: e68376e7b87f983cbf2a95ea0c8c86cb0676e7cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
error[E0658]: dereferencing raw mutable 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: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
   = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable

error[E0658]: dereferencing raw mutable 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: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
   = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable

error[E0658]: dereferencing raw mutable 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: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
   = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable

error[E0658]: dereferencing raw mutable pointers in constant functions is unstable
  --> $DIR/min_const_fn_unsafe_bad.rs:10:80
   |
LL | const unsafe fn bad_const_unsafe_deref_raw_underscore(x: *mut usize) { let _ = *x; }
   |                                                                                ^^
   |
   = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
   = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable

error: aborting due to 4 previous errors

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