about summary refs log tree commit diff
path: root/tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.stderr
blob: 96263998ad42c3a472a45973f8564ed2f8171827 (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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
error[E0080]: constructing invalid value at .<enum-variant(Some)>.0: encountered mutable reference in `const` value
  --> $DIR/mut_ref_in_final_dynamic_check.rs:19:1
   |
LL | const MUT: Option<&mut i32> = helper();
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
   |
   = note: the rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
               HEX_DUMP
           }

error[E0080]: constructing invalid value at .<enum-variant(Some)>.0: encountered a dangling reference (0x2a[noalloc] has no provenance)
  --> $DIR/mut_ref_in_final_dynamic_check.rs:25:1
   |
LL | const INT2PTR: Option<&mut i32> = helper_int2ptr();
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
   |
   = note: the rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
               HEX_DUMP
           }

error[E0080]: constructing invalid value at .<enum-variant(Some)>.0: encountered a dangling reference (0x2a[noalloc] has no provenance)
  --> $DIR/mut_ref_in_final_dynamic_check.rs:26:1
   |
LL | static INT2PTR_STATIC: Option<&mut i32> = helper_int2ptr();
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
   |
   = note: the rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
               HEX_DUMP
           }

error[E0080]: constructing invalid value at .<enum-variant(Some)>.0: encountered a dangling reference (use-after-free)
  --> $DIR/mut_ref_in_final_dynamic_check.rs:32:1
   |
LL | const DANGLING: Option<&mut i32> = helper_dangling();
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
   |
   = note: the rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
               HEX_DUMP
           }

error[E0080]: constructing invalid value at .<enum-variant(Some)>.0: encountered a dangling reference (use-after-free)
  --> $DIR/mut_ref_in_final_dynamic_check.rs:33:1
   |
LL | static DANGLING_STATIC: Option<&mut i32> = helper_dangling();
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
   |
   = note: the rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
               HEX_DUMP
           }

error: aborting due to 5 previous errors

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