2020-10-24 13:49:17 -05:00
error[E0080]: it is undefined behavior to use this value
2021-03-31 03:09:16 -05:00
--> $DIR/mutable_references_err.rs:17:1
2020-04-29 03:00:22 -05:00
|
2022-02-13 09:27:59 -06:00
LL | const MUH: Meh = Meh {
| ^^^^^^^^^^^^^^ constructing invalid value at .x.<deref>: encountered `UnsafeCell` in a `const`
2020-10-24 13:49:17 -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.
2021-02-01 06:02:31 -06:00
= note: the raw bytes of the constant (size: 8, align: 8) {
2021-07-12 17:21:35 -05:00
╾───────alloc3────────╼ │ ╾──────╼
2021-02-01 06:02:31 -06:00
}
2020-04-29 03:00:22 -05:00
2020-10-24 13:49:17 -05:00
error[E0080]: it is undefined behavior to use this value
2021-03-31 03:09:16 -05:00
--> $DIR/mutable_references_err.rs:27:1
2020-04-29 03:00:22 -05:00
|
LL | const SNEAKY: &dyn Sync = &Synced { x: UnsafeCell::new(42) };
2022-02-13 09:27:59 -06:00
| ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.<dyn-downcast>.x: encountered `UnsafeCell` in a `const`
2020-10-24 13:49:17 -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.
2021-02-01 06:02:31 -06:00
= note: the raw bytes of the constant (size: 16, align: 8) {
2021-07-12 17:21:35 -05:00
╾───────alloc7────────╼ ╾───────alloc9────────╼ │ ╾──────╼╾──────╼
2021-02-01 06:02:31 -06:00
}
2020-04-29 03:00:22 -05:00
2020-10-25 04:22:56 -05:00
error[E0080]: it is undefined behavior to use this value
2021-03-31 03:09:16 -05:00
--> $DIR/mutable_references_err.rs:31:1
2020-04-29 03:00:22 -05:00
|
LL | const BLUNT: &mut i32 = &mut 42;
2022-02-13 09:27:59 -06:00
| ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered mutable reference in a `const`
2020-10-25 04:22:56 -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.
2021-02-01 06:02:31 -06:00
= note: the raw bytes of the constant (size: 8, align: 8) {
2021-07-12 17:21:35 -05:00
╾───────alloc11───────╼ │ ╾──────╼
2021-02-01 06:02:31 -06:00
}
2020-04-29 03:00:22 -05:00
warning: skipping const checks
|
help: skipping check that does not even have a feature gate
2021-03-31 03:09:16 -05:00
--> $DIR/mutable_references_err.rs:18:8
2020-04-29 03:00:22 -05:00
|
LL | x: &UnsafeCell::new(42),
| ^^^^^^^^^^^^^^^^^^^^
help: skipping check that does not even have a feature gate
2021-03-31 03:09:16 -05:00
--> $DIR/mutable_references_err.rs:27:27
2020-04-29 03:00:22 -05:00
|
LL | const SNEAKY: &dyn Sync = &Synced { x: UnsafeCell::new(42) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2020-09-16 15:09:46 -05:00
help: skipping check that does not even have a feature gate
2021-03-31 03:09:16 -05:00
--> $DIR/mutable_references_err.rs:31:25
2020-04-29 03:00:22 -05:00
|
LL | const BLUNT: &mut i32 = &mut 42;
| ^^^^^^^
error: aborting due to 3 previous errors; 1 warning emitted
2020-10-24 13:49:17 -05:00
For more information about this error, try `rustc --explain E0080`.