@@ -3,42 +3,90 @@ error: encountered mutable pointer in final value of static
3
3
|
4
4
LL | static REF: &AtomicI32 = &AtomicI32::new(42);
5
5
| ^^^^^^^^^^^^^^^^^^^^^^
6
+ |
7
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
8
+ = note: for more information, see issue #122153 <https://github.com/rust-lang/rust/issues/122153>
9
+ note: the lint level is defined here
10
+ --> $DIR/static-no-inner-mut.rs:6:9
11
+ |
12
+ LL | #![deny(const_eval_mutable_ptr_in_final_value)]
13
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6
14
7
15
error: encountered mutable pointer in final value of static
8
- --> $DIR/static-no-inner-mut.rs:10 :1
16
+ --> $DIR/static-no-inner-mut.rs:13 :1
9
17
|
10
18
LL | static REFMUT: &mut i32 = &mut 0;
11
19
| ^^^^^^^^^^^^^^^^^^^^^^^
20
+ |
21
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
22
+ = note: for more information, see issue #122153 <https://github.com/rust-lang/rust/issues/122153>
12
23
13
- error: encountered mutable pointer in final value of static
24
+ error[E0080]: it is undefined behavior to use this value
14
25
--> $DIR/static-no-inner-mut.rs:13:1
15
26
|
27
+ LL | static REFMUT: &mut i32 = &mut 0;
28
+ | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered mutable reference or box pointing to read-only memory
29
+ |
30
+ = 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.
31
+ = note: the raw bytes of the constant (size: 4, align: 4) {
32
+ ╾ALLOC0╼ │ ╾──╼
33
+ }
34
+
35
+ error: encountered mutable pointer in final value of static
36
+ --> $DIR/static-no-inner-mut.rs:19:1
37
+ |
16
38
LL | static REF2: &AtomicI32 = {let x = AtomicI32::new(42); &{x}};
17
39
| ^^^^^^^^^^^^^^^^^^^^^^^
40
+ |
41
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
42
+ = note: for more information, see issue #122153 <https://github.com/rust-lang/rust/issues/122153>
18
43
19
44
error: encountered mutable pointer in final value of static
20
- --> $DIR/static-no-inner-mut.rs:14 :1
45
+ --> $DIR/static-no-inner-mut.rs:23 :1
21
46
|
22
47
LL | static REFMUT2: &mut i32 = {let mut x = 0; &mut {x}};
23
48
| ^^^^^^^^^^^^^^^^^^^^^^^^
49
+ |
50
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
51
+ = note: for more information, see issue #122153 <https://github.com/rust-lang/rust/issues/122153>
52
+
53
+ error[E0080]: it is undefined behavior to use this value
54
+ --> $DIR/static-no-inner-mut.rs:23:1
55
+ |
56
+ LL | static REFMUT2: &mut i32 = {let mut x = 0; &mut {x}};
57
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered mutable reference or box pointing to read-only memory
58
+ |
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: 4, align: 4) {
61
+ ╾ALLOC1╼ │ ╾──╼
62
+ }
24
63
25
64
error: encountered mutable pointer in final value of static
26
- --> $DIR/static-no-inner-mut.rs:29 :1
65
+ --> $DIR/static-no-inner-mut.rs:41 :1
27
66
|
28
67
LL | static RAW_SYNC: SyncPtr<AtomicI32> = SyncPtr { x: &AtomicI32::new(42) };
29
68
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
69
+ |
70
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
71
+ = note: for more information, see issue #122153 <https://github.com/rust-lang/rust/issues/122153>
30
72
31
73
error: encountered mutable pointer in final value of static
32
- --> $DIR/static-no-inner-mut.rs:31 :1
74
+ --> $DIR/static-no-inner-mut.rs:45 :1
33
75
|
34
76
LL | static RAW_MUT_CAST: SyncPtr<i32> = SyncPtr { x : &mut 42 as *mut _ as *const _ };
35
77
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
78
+ |
79
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
80
+ = note: for more information, see issue #122153 <https://github.com/rust-lang/rust/issues/122153>
36
81
37
82
error: encountered mutable pointer in final value of static
38
- --> $DIR/static-no-inner-mut.rs:33 :1
83
+ --> $DIR/static-no-inner-mut.rs:49 :1
39
84
|
40
85
LL | static RAW_MUT_COERCE: SyncPtr<i32> = SyncPtr { x: &mut 0 };
41
86
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
87
+ |
88
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
89
+ = note: for more information, see issue #122153 <https://github.com/rust-lang/rust/issues/122153>
42
90
43
91
warning: skipping const checks
44
92
|
@@ -48,35 +96,141 @@ help: skipping check that does not even have a feature gate
48
96
LL | static REF: &AtomicI32 = &AtomicI32::new(42);
49
97
| ^^^^^^^^^^^^^^^^^^^
50
98
help: skipping check that does not even have a feature gate
51
- --> $DIR/static-no-inner-mut.rs:10 :27
99
+ --> $DIR/static-no-inner-mut.rs:13 :27
52
100
|
53
101
LL | static REFMUT: &mut i32 = &mut 0;
54
102
| ^^^^^^
55
103
help: skipping check that does not even have a feature gate
56
- --> $DIR/static-no-inner-mut.rs:13 :56
104
+ --> $DIR/static-no-inner-mut.rs:19 :56
57
105
|
58
106
LL | static REF2: &AtomicI32 = {let x = AtomicI32::new(42); &{x}};
59
107
| ^^^^
60
108
help: skipping check that does not even have a feature gate
61
- --> $DIR/static-no-inner-mut.rs:14 :44
109
+ --> $DIR/static-no-inner-mut.rs:23 :44
62
110
|
63
111
LL | static REFMUT2: &mut i32 = {let mut x = 0; &mut {x}};
64
112
| ^^^^^^^^
65
113
help: skipping check that does not even have a feature gate
66
- --> $DIR/static-no-inner-mut.rs:29 :52
114
+ --> $DIR/static-no-inner-mut.rs:41 :52
67
115
|
68
116
LL | static RAW_SYNC: SyncPtr<AtomicI32> = SyncPtr { x: &AtomicI32::new(42) };
69
117
| ^^^^^^^^^^^^^^^^^^^
70
118
help: skipping check that does not even have a feature gate
71
- --> $DIR/static-no-inner-mut.rs:31 :51
119
+ --> $DIR/static-no-inner-mut.rs:45 :51
72
120
|
73
121
LL | static RAW_MUT_CAST: SyncPtr<i32> = SyncPtr { x : &mut 42 as *mut _ as *const _ };
74
122
| ^^^^^^^
75
123
help: skipping check that does not even have a feature gate
76
- --> $DIR/static-no-inner-mut.rs:33 :52
124
+ --> $DIR/static-no-inner-mut.rs:49 :52
77
125
|
78
126
LL | static RAW_MUT_COERCE: SyncPtr<i32> = SyncPtr { x: &mut 0 };
79
127
| ^^^^^^
80
128
81
- error: aborting due to 7 previous errors; 1 warning emitted
129
+ error: aborting due to 9 previous errors; 1 warning emitted
130
+
131
+ For more information about this error, try `rustc --explain E0080`.
132
+ Future incompatibility report: Future breakage diagnostic:
133
+ error: encountered mutable pointer in final value of static
134
+ --> $DIR/static-no-inner-mut.rs:9:1
135
+ |
136
+ LL | static REF: &AtomicI32 = &AtomicI32::new(42);
137
+ | ^^^^^^^^^^^^^^^^^^^^^^
138
+ |
139
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
140
+ = note: for more information, see issue #122153 <https://github.com/rust-lang/rust/issues/122153>
141
+ note: the lint level is defined here
142
+ --> $DIR/static-no-inner-mut.rs:6:9
143
+ |
144
+ LL | #![deny(const_eval_mutable_ptr_in_final_value)]
145
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
146
+
147
+ Future breakage diagnostic:
148
+ error: encountered mutable pointer in final value of static
149
+ --> $DIR/static-no-inner-mut.rs:13:1
150
+ |
151
+ LL | static REFMUT: &mut i32 = &mut 0;
152
+ | ^^^^^^^^^^^^^^^^^^^^^^^
153
+ |
154
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
155
+ = note: for more information, see issue #122153 <https://github.com/rust-lang/rust/issues/122153>
156
+ note: the lint level is defined here
157
+ --> $DIR/static-no-inner-mut.rs:6:9
158
+ |
159
+ LL | #![deny(const_eval_mutable_ptr_in_final_value)]
160
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
161
+
162
+ Future breakage diagnostic:
163
+ error: encountered mutable pointer in final value of static
164
+ --> $DIR/static-no-inner-mut.rs:19:1
165
+ |
166
+ LL | static REF2: &AtomicI32 = {let x = AtomicI32::new(42); &{x}};
167
+ | ^^^^^^^^^^^^^^^^^^^^^^^
168
+ |
169
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
170
+ = note: for more information, see issue #122153 <https://github.com/rust-lang/rust/issues/122153>
171
+ note: the lint level is defined here
172
+ --> $DIR/static-no-inner-mut.rs:6:9
173
+ |
174
+ LL | #![deny(const_eval_mutable_ptr_in_final_value)]
175
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
176
+
177
+ Future breakage diagnostic:
178
+ error: encountered mutable pointer in final value of static
179
+ --> $DIR/static-no-inner-mut.rs:23:1
180
+ |
181
+ LL | static REFMUT2: &mut i32 = {let mut x = 0; &mut {x}};
182
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
183
+ |
184
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
185
+ = note: for more information, see issue #122153 <https://github.com/rust-lang/rust/issues/122153>
186
+ note: the lint level is defined here
187
+ --> $DIR/static-no-inner-mut.rs:6:9
188
+ |
189
+ LL | #![deny(const_eval_mutable_ptr_in_final_value)]
190
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
191
+
192
+ Future breakage diagnostic:
193
+ error: encountered mutable pointer in final value of static
194
+ --> $DIR/static-no-inner-mut.rs:41:1
195
+ |
196
+ LL | static RAW_SYNC: SyncPtr<AtomicI32> = SyncPtr { x: &AtomicI32::new(42) };
197
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
198
+ |
199
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
200
+ = note: for more information, see issue #122153 <https://github.com/rust-lang/rust/issues/122153>
201
+ note: the lint level is defined here
202
+ --> $DIR/static-no-inner-mut.rs:6:9
203
+ |
204
+ LL | #![deny(const_eval_mutable_ptr_in_final_value)]
205
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
206
+
207
+ Future breakage diagnostic:
208
+ error: encountered mutable pointer in final value of static
209
+ --> $DIR/static-no-inner-mut.rs:45:1
210
+ |
211
+ LL | static RAW_MUT_CAST: SyncPtr<i32> = SyncPtr { x : &mut 42 as *mut _ as *const _ };
212
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
213
+ |
214
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
215
+ = note: for more information, see issue #122153 <https://github.com/rust-lang/rust/issues/122153>
216
+ note: the lint level is defined here
217
+ --> $DIR/static-no-inner-mut.rs:6:9
218
+ |
219
+ LL | #![deny(const_eval_mutable_ptr_in_final_value)]
220
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
221
+
222
+ Future breakage diagnostic:
223
+ error: encountered mutable pointer in final value of static
224
+ --> $DIR/static-no-inner-mut.rs:49:1
225
+ |
226
+ LL | static RAW_MUT_COERCE: SyncPtr<i32> = SyncPtr { x: &mut 0 };
227
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
228
+ |
229
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
230
+ = note: for more information, see issue #122153 <https://github.com/rust-lang/rust/issues/122153>
231
+ note: the lint level is defined here
232
+ --> $DIR/static-no-inner-mut.rs:6:9
233
+ |
234
+ LL | #![deny(const_eval_mutable_ptr_in_final_value)]
235
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
82
236
0 commit comments