]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/miri_unleashed/mutable_references_err.32bit.stderr
Rollup merge of #96935 - thomcc:atomicptr-strict-prov, r=dtolnay
[rust.git] / src / test / ui / consts / miri_unleashed / mutable_references_err.32bit.stderr
1 error[E0080]: it is undefined behavior to use this value
2   --> $DIR/mutable_references_err.rs:17:1
3    |
4 LL | const MUH: Meh = Meh {
5    | ^^^^^^^^^^^^^^ constructing invalid value at .x.<deref>: encountered `UnsafeCell` in a `const`
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.
8    = note: the raw bytes of the constant (size: 4, align: 4) {
9                ╾─alloc3──╼                                     │ ╾──╼
10            }
11
12 error[E0080]: it is undefined behavior to use this value
13   --> $DIR/mutable_references_err.rs:27:1
14    |
15 LL | const SNEAKY: &dyn Sync = &Synced { x: UnsafeCell::new(42) };
16    | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.<dyn-downcast>.x: encountered `UnsafeCell` in a `const`
17    |
18    = 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.
19    = note: the raw bytes of the constant (size: 8, align: 4) {
20                ╾─alloc7──╼ ╾─alloc9──╼                         │ ╾──╼╾──╼
21            }
22
23 error[E0080]: it is undefined behavior to use this value
24   --> $DIR/mutable_references_err.rs:31:1
25    |
26 LL | const BLUNT: &mut i32 = &mut 42;
27    | ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered mutable reference in a `const`
28    |
29    = 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.
30    = note: the raw bytes of the constant (size: 4, align: 4) {
31                ╾─alloc11─╼                                     │ ╾──╼
32            }
33
34 warning: skipping const checks
35    |
36 help: skipping check that does not even have a feature gate
37   --> $DIR/mutable_references_err.rs:18:8
38    |
39 LL |     x: &UnsafeCell::new(42),
40    |        ^^^^^^^^^^^^^^^^^^^^
41 help: skipping check that does not even have a feature gate
42   --> $DIR/mutable_references_err.rs:27:27
43    |
44 LL | const SNEAKY: &dyn Sync = &Synced { x: UnsafeCell::new(42) };
45    |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
46 help: skipping check that does not even have a feature gate
47   --> $DIR/mutable_references_err.rs:31:25
48    |
49 LL | const BLUNT: &mut i32 = &mut 42;
50    |                         ^^^^^^^
51
52 error: aborting due to 3 previous errors; 1 warning emitted
53
54 For more information about this error, try `rustc --explain E0080`.