2019-12-16 14:23:42 +00:00
error[E0080]: it is undefined behavior to use this value
2021-03-31 08:09:16 +00:00
--> $DIR/const-points-to-static.rs:6:1
2019-12-16 14:23:42 +00:00
|
LL | const TEST: &u8 = &MY_STATIC;
2022-08-23 01:25:03 +00:00
| ^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable in a constant
2019-12-16 14:23:42 +00:00
|
= 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.
2021-02-01 12:02:31 +00:00
= note: the raw bytes of the constant (size: 8, align: 8) {
2023-10-16 18:49:32 +00:00
╾ALLOC0╼ │ ╾──────╼
2021-02-01 12:02:31 +00:00
}
2019-12-16 14:23:42 +00:00
2020-05-03 12:23:08 +00:00
warning: skipping const checks
|
help: skipping check that does not even have a feature gate
2021-03-31 08:09:16 +00:00
--> $DIR/const-points-to-static.rs:6:20
2020-05-03 12:23:08 +00:00
|
LL | const TEST: &u8 = &MY_STATIC;
| ^^^^^^^^^
2020-03-11 15:30:09 +00:00
error: aborting due to previous error; 1 warning emitted
2019-12-16 14:23:42 +00:00
For more information about this error, try `rustc --explain E0080`.