You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error[E0080]: it is undefined behavior to use this value
16
-
--> $DIR/mutable_references.rs:7:1
16
+
--> $DIR/mutable_references.rs:10:1
17
17
|
18
18
LL | static FOO: &&mut u32 = &&mut 42;
19
19
| ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>: encountered mutable reference or box pointing to read-only memory
20
20
|
21
21
= 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.
22
-
= note: the raw bytes of the constant (size: 8, align: 8) {
23
-
╾ALLOC0<imm>╼ │ ╾──────╼
22
+
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
23
+
HEX_DUMP
24
24
}
25
25
26
26
error: encountered mutable pointer in final value of static
| ^^^^^^^^^^^^^^^ constructing invalid value at .x.<deref>: encountered `UnsafeCell` in read-only memory
58
58
|
59
59
= 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.
60
-
= note: the raw bytes of the constant (size: 8, align: 8) {
61
-
╾ALLOC1╼ │ ╾──────╼
60
+
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
61
+
HEX_DUMP
62
62
}
63
63
64
64
error: encountered mutable pointer in final value of static
= note: for more information, see issue #122153 <https://github.com/rust-lang/rust/issues/122153>
72
72
73
73
error[E0080]: it is undefined behavior to use this value
74
-
--> $DIR/mutable_references.rs:31:1
74
+
--> $DIR/mutable_references.rs:34:1
75
75
|
76
76
LL | static OH_YES: &mut i32 = &mut 42;
77
77
| ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered mutable reference or box pointing to read-only memory
78
78
|
79
79
= 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.
80
-
= note: the raw bytes of the constant (size: 8, align: 8) {
81
-
╾ALLOC2╼ │ ╾──────╼
80
+
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
81
+
HEX_DUMP
82
82
}
83
83
84
84
error[E0594]: cannot assign to `*OH_YES`, as `OH_YES` is an immutable static item
85
-
--> $DIR/mutable_references.rs:40:5
85
+
--> $DIR/mutable_references.rs:43:5
86
86
|
87
87
LL | *OH_YES = 99;
88
88
| ^^^^^^^^^^^^ cannot assign
89
89
90
90
warning: skipping const checks
91
91
|
92
92
help: skipping check that does not even have a feature gate
93
-
--> $DIR/mutable_references.rs:7:26
93
+
--> $DIR/mutable_references.rs:10:26
94
94
|
95
95
LL | static FOO: &&mut u32 = &&mut 42;
96
96
| ^^^^^^^
97
97
help: skipping check that does not even have a feature gate
98
-
--> $DIR/mutable_references.rs:12:23
98
+
--> $DIR/mutable_references.rs:15:23
99
99
|
100
100
LL | static BAR: &mut () = &mut ();
101
101
| ^^^^^^^
102
102
help: skipping check that does not even have a feature gate
103
-
--> $DIR/mutable_references.rs:18:28
103
+
--> $DIR/mutable_references.rs:21:28
104
104
|
105
105
LL | static BOO: &mut Foo<()> = &mut Foo(());
106
106
| ^^^^^^^^^^^^
107
107
help: skipping check that does not even have a feature gate
0 commit comments