summaryrefslogtreecommitdiffstats
path: root/src/test/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.stderr
blob: 234e55e3a96c8beb7e5cb0cd84e332fa35ceeade (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
error[E0080]: evaluation of constant value failed
  --> $DIR/mut_ref_in_final_dynamic_check.rs:13:10
   |
LL |     Some(&mut *(42 as *mut i32))
   |          ^^^^^^^^^^^^^^^^^^^^^^
   |          |
   |          dereferencing pointer failed: 0x2a[noalloc] is a dangling pointer (it has no provenance)
   |          inside `helper` at $DIR/mut_ref_in_final_dynamic_check.rs:13:10
...
LL | const A: Option<&mut i32> = helper();
   |                             -------- inside `A` at $DIR/mut_ref_in_final_dynamic_check.rs:18:29

error: encountered dangling pointer in final constant
  --> $DIR/mut_ref_in_final_dynamic_check.rs:25:1
   |
LL | const B: Option<&mut i32> = helper2();
   | ^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 2 previous errors

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