]>
Commit | Line | Data |
---|---|---|
dfeec247 | 1 | error[E0080]: it is undefined behavior to use this value |
cdc7bbd5 | 2 | --> $DIR/const-points-to-static.rs:6:1 |
dfeec247 XL |
3 | | |
4 | LL | const TEST: &u8 = &MY_STATIC; | |
f2b60f7d | 5 | | ^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable in a constant |
dfeec247 XL |
6 | | |
7 | = 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. | |
cdc7bbd5 | 8 | = note: the raw bytes of the constant (size: 8, align: 8) { |
136023e0 | 9 | ╾───────alloc1────────╼ │ ╾──────╼ |
cdc7bbd5 | 10 | } |
dfeec247 | 11 | |
f9f354fc XL |
12 | warning: skipping const checks |
13 | | | |
14 | help: skipping check that does not even have a feature gate | |
cdc7bbd5 | 15 | --> $DIR/const-points-to-static.rs:6:20 |
f9f354fc XL |
16 | | |
17 | LL | const TEST: &u8 = &MY_STATIC; | |
18 | | ^^^^^^^^^ | |
19 | ||
ba9703b0 | 20 | error: aborting due to previous error; 1 warning emitted |
dfeec247 XL |
21 | |
22 | For more information about this error, try `rustc --explain E0080`. |