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