summaryrefslogtreecommitdiffstats
path: root/src/test/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.stderr
blob: 6e110dbdd6417dd5f87e0f8e845437e592dd6d6f (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
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)
   |
note: inside `helper`
  --> $DIR/mut_ref_in_final_dynamic_check.rs:13:10
   |
LL |     Some(&mut *(42 as *mut i32))
   |          ^^^^^^^^^^^^^^^^^^^^^^
note: inside `A`
  --> $DIR/mut_ref_in_final_dynamic_check.rs:18:29
   |
LL | const A: Option<&mut i32> = helper();
   |                             ^^^^^^^^

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`.