]> git.proxmox.com Git - rustc.git/blame - src/test/ui/consts/miri_unleashed/mutable_references_err.stderr
New upstream version 1.49.0~beta.4+dfsg1
[rustc.git] / src / test / ui / consts / miri_unleashed / mutable_references_err.stderr
CommitLineData
29967ef6 1error[E0080]: it is undefined behavior to use this value
f9f354fc
XL
2 --> $DIR/mutable_references_err.rs:16:1
3 |
4LL | / const MUH: Meh = Meh {
5LL | | x: &UnsafeCell::new(42),
6LL | | };
29967ef6
XL
7 | |__^ type validation failed: encountered `UnsafeCell` in a `const` at .x.<deref>
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.
f9f354fc 10
29967ef6 11error[E0080]: it is undefined behavior to use this value
f9f354fc
XL
12 --> $DIR/mutable_references_err.rs:26:1
13 |
14LL | const SNEAKY: &dyn Sync = &Synced { x: UnsafeCell::new(42) };
29967ef6
XL
15 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered `UnsafeCell` in a `const` at .<deref>.<dyn-downcast>.x
16 |
17 = 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.
f9f354fc 18
29967ef6 19error[E0080]: it is undefined behavior to use this value
f9f354fc
XL
20 --> $DIR/mutable_references_err.rs:30:1
21 |
22LL | const BLUNT: &mut i32 = &mut 42;
29967ef6
XL
23 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered mutable reference in a `const`
24 |
25 = 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.
f9f354fc
XL
26
27warning: skipping const checks
28 |
29help: skipping check that does not even have a feature gate
30 --> $DIR/mutable_references_err.rs:17:8
31 |
32LL | x: &UnsafeCell::new(42),
33 | ^^^^^^^^^^^^^^^^^^^^
34help: skipping check that does not even have a feature gate
35 --> $DIR/mutable_references_err.rs:26:27
36 |
37LL | const SNEAKY: &dyn Sync = &Synced { x: UnsafeCell::new(42) };
38 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1b1a35ee 39help: skipping check that does not even have a feature gate
f9f354fc
XL
40 --> $DIR/mutable_references_err.rs:30:25
41 |
42LL | const BLUNT: &mut i32 = &mut 42;
43 | ^^^^^^^
44
45error: aborting due to 3 previous errors; 1 warning emitted
46
29967ef6 47For more information about this error, try `rustc --explain E0080`.