]>
Commit | Line | Data |
---|---|---|
29967ef6 | 1 | error[E0080]: it is undefined behavior to use this value |
2b03887a | 2 | --> $DIR/mutable_references_err.rs:15:1 |
f9f354fc | 3 | | |
064997fb FG |
4 | LL | const MUH: Meh = Meh { |
5 | | ^^^^^^^^^^^^^^ constructing invalid value at .x.<deref>: encountered `UnsafeCell` in a `const` | |
29967ef6 XL |
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. | |
cdc7bbd5 | 8 | = note: the raw bytes of the constant (size: 4, align: 4) { |
ed00b5ec | 9 | ╾ALLOC0╼ │ ╾──╼ |
cdc7bbd5 | 10 | } |
f9f354fc | 11 | |
29967ef6 | 12 | error[E0080]: it is undefined behavior to use this value |
2b03887a | 13 | --> $DIR/mutable_references_err.rs:25:1 |
f9f354fc XL |
14 | | |
15 | LL | const SNEAKY: &dyn Sync = &Synced { x: UnsafeCell::new(42) }; | |
064997fb | 16 | | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.<dyn-downcast>.x: encountered `UnsafeCell` in a `const` |
29967ef6 XL |
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. | |
cdc7bbd5 | 19 | = note: the raw bytes of the constant (size: 8, align: 4) { |
ed00b5ec | 20 | ╾ALLOC1╼ ╾ALLOC2╼ │ ╾──╼╾──╼ |
cdc7bbd5 | 21 | } |
f9f354fc | 22 | |
29967ef6 | 23 | error[E0080]: it is undefined behavior to use this value |
2b03887a | 24 | --> $DIR/mutable_references_err.rs:29:1 |
f9f354fc XL |
25 | | |
26 | LL | const BLUNT: &mut i32 = &mut 42; | |
064997fb | 27 | | ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered mutable reference in a `const` |
29967ef6 XL |
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. | |
cdc7bbd5 | 30 | = note: the raw bytes of the constant (size: 4, align: 4) { |
ed00b5ec | 31 | ╾ALLOC3╼ │ ╾──╼ |
cdc7bbd5 | 32 | } |
f9f354fc XL |
33 | |
34 | warning: skipping const checks | |
35 | | | |
36 | help: skipping check that does not even have a feature gate | |
2b03887a | 37 | --> $DIR/mutable_references_err.rs:16:8 |
f9f354fc XL |
38 | | |
39 | LL | x: &UnsafeCell::new(42), | |
40 | | ^^^^^^^^^^^^^^^^^^^^ | |
41 | help: skipping check that does not even have a feature gate | |
2b03887a | 42 | --> $DIR/mutable_references_err.rs:25:27 |
f9f354fc XL |
43 | | |
44 | LL | const SNEAKY: &dyn Sync = &Synced { x: UnsafeCell::new(42) }; | |
45 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
1b1a35ee | 46 | help: skipping check that does not even have a feature gate |
2b03887a | 47 | --> $DIR/mutable_references_err.rs:29:25 |
f9f354fc XL |
48 | | |
49 | LL | const BLUNT: &mut i32 = &mut 42; | |
50 | | ^^^^^^^ | |
51 | ||
52 | error: aborting due to 3 previous errors; 1 warning emitted | |
53 | ||
29967ef6 | 54 | For more information about this error, try `rustc --explain E0080`. |