]>
Commit | Line | Data |
---|---|---|
29967ef6 | 1 | error[E0080]: it is undefined behavior to use this value |
f9f354fc XL |
2 | --> $DIR/mutable_references_err.rs:16:1 |
3 | | | |
4 | LL | / const MUH: Meh = Meh { | |
5 | LL | | x: &UnsafeCell::new(42), | |
6 | LL | | }; | |
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 | 11 | error[E0080]: it is undefined behavior to use this value |
f9f354fc XL |
12 | --> $DIR/mutable_references_err.rs:26:1 |
13 | | | |
14 | LL | 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 | 19 | error[E0080]: it is undefined behavior to use this value |
f9f354fc XL |
20 | --> $DIR/mutable_references_err.rs:30:1 |
21 | | | |
22 | LL | 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 | |
27 | warning: skipping const checks | |
28 | | | |
29 | help: skipping check that does not even have a feature gate | |
30 | --> $DIR/mutable_references_err.rs:17:8 | |
31 | | | |
32 | LL | x: &UnsafeCell::new(42), | |
33 | | ^^^^^^^^^^^^^^^^^^^^ | |
34 | help: skipping check that does not even have a feature gate | |
35 | --> $DIR/mutable_references_err.rs:26:27 | |
36 | | | |
37 | LL | const SNEAKY: &dyn Sync = &Synced { x: UnsafeCell::new(42) }; | |
38 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
1b1a35ee | 39 | help: skipping check that does not even have a feature gate |
f9f354fc XL |
40 | --> $DIR/mutable_references_err.rs:30:25 |
41 | | | |
42 | LL | const BLUNT: &mut i32 = &mut 42; | |
43 | | ^^^^^^^ | |
44 | ||
45 | error: aborting due to 3 previous errors; 1 warning emitted | |
46 | ||
29967ef6 | 47 | For more information about this error, try `rustc --explain E0080`. |