rust/src/test/ui/consts/const-eval/ref_to_int_match.32bit.stderr

27 lines
1.1 KiB
Plaintext
Raw Normal View History

2021-03-31 04:33:45 -05:00
error[E0080]: it is undefined behavior to use this value
--> $DIR/ref_to_int_match.rs:26:1
|
LL | const BAR: Int = unsafe { Foo { r: &42 }.f };
2021-07-12 17:21:35 -05:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered pointer to alloc3, but expected initialized plain (non-pointer) bytes
2021-03-31 04:33:45 -05: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.
= note: the raw bytes of the constant (size: 4, align: 4) {
2021-07-12 17:21:35 -05:00
╾─alloc3──╼ │ ╾──╼
2021-03-31 04:33:45 -05:00
}
error: could not evaluate constant pattern
--> $DIR/ref_to_int_match.rs:8:14
|
LL | 10..=BAR => {},
| ^^^
error: could not evaluate constant pattern
--> $DIR/ref_to_int_match.rs:8:14
|
LL | 10..=BAR => {},
| ^^^
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0080`.