1
1
error: this `unsafe` block contains 2 unsafe operations, expected only one
2
- --> tests/ui/multiple_unsafe_ops_per_block.rs:34 :5
2
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:38 :5
3
3
|
4
4
LL | / unsafe {
5
5
LL | |
@@ -9,20 +9,20 @@ LL | | }
9
9
| |_____^
10
10
|
11
11
note: modification of a mutable static occurs here
12
- --> tests/ui/multiple_unsafe_ops_per_block.rs:36 :9
12
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:40 :9
13
13
|
14
14
LL | STATIC += 1;
15
15
| ^^^^^^^^^^^
16
16
note: unsafe function call occurs here
17
- --> tests/ui/multiple_unsafe_ops_per_block.rs:37 :9
17
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:41 :9
18
18
|
19
19
LL | not_very_safe();
20
20
| ^^^^^^^^^^^^^^^
21
21
= note: `-D clippy::multiple-unsafe-ops-per-block` implied by `-D warnings`
22
22
= help: to override `-D warnings` add `#[allow(clippy::multiple_unsafe_ops_per_block)]`
23
23
24
24
error: this `unsafe` block contains 2 unsafe operations, expected only one
25
- --> tests/ui/multiple_unsafe_ops_per_block.rs:44 :5
25
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:48 :5
26
26
|
27
27
LL | / unsafe {
28
28
LL | |
@@ -32,18 +32,18 @@ LL | | }
32
32
| |_____^
33
33
|
34
34
note: union field access occurs here
35
- --> tests/ui/multiple_unsafe_ops_per_block.rs:46 :14
35
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:50 :14
36
36
|
37
37
LL | drop(u.u);
38
38
| ^^^
39
39
note: raw pointer dereference occurs here
40
- --> tests/ui/multiple_unsafe_ops_per_block.rs:47 :9
40
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:51 :9
41
41
|
42
42
LL | *raw_ptr();
43
43
| ^^^^^^^^^^
44
44
45
45
error: this `unsafe` block contains 3 unsafe operations, expected only one
46
- --> tests/ui/multiple_unsafe_ops_per_block.rs:52 :5
46
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:56 :5
47
47
|
48
48
LL | / unsafe {
49
49
LL | |
@@ -54,23 +54,23 @@ LL | | }
54
54
| |_____^
55
55
|
56
56
note: inline assembly used here
57
- --> tests/ui/multiple_unsafe_ops_per_block.rs:54 :9
57
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:58 :9
58
58
|
59
59
LL | asm!("nop");
60
60
| ^^^^^^^^^^^
61
61
note: unsafe method call occurs here
62
- --> tests/ui/multiple_unsafe_ops_per_block.rs:55 :9
62
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:59 :9
63
63
|
64
64
LL | sample.not_very_safe();
65
65
| ^^^^^^^^^^^^^^^^^^^^^^
66
66
note: modification of a mutable static occurs here
67
- --> tests/ui/multiple_unsafe_ops_per_block.rs:56 :9
67
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:60 :9
68
68
|
69
69
LL | STATIC = 0;
70
70
| ^^^^^^^^^^
71
71
72
72
error: this `unsafe` block contains 6 unsafe operations, expected only one
73
- --> tests/ui/multiple_unsafe_ops_per_block.rs:62 :5
73
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:66 :5
74
74
|
75
75
LL | / unsafe {
76
76
LL | |
@@ -82,55 +82,55 @@ LL | | }
82
82
| |_____^
83
83
|
84
84
note: union field access occurs here
85
- --> tests/ui/multiple_unsafe_ops_per_block.rs:64 :14
85
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:68 :14
86
86
|
87
87
LL | drop(u.u);
88
88
| ^^^
89
89
note: access of a mutable static occurs here
90
- --> tests/ui/multiple_unsafe_ops_per_block.rs:65 :14
90
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:69 :14
91
91
|
92
92
LL | drop(STATIC);
93
93
| ^^^^^^
94
94
note: unsafe method call occurs here
95
- --> tests/ui/multiple_unsafe_ops_per_block.rs:66 :9
95
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:70 :9
96
96
|
97
97
LL | sample.not_very_safe();
98
98
| ^^^^^^^^^^^^^^^^^^^^^^
99
99
note: unsafe function call occurs here
100
- --> tests/ui/multiple_unsafe_ops_per_block.rs:67 :9
100
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:71 :9
101
101
|
102
102
LL | not_very_safe();
103
103
| ^^^^^^^^^^^^^^^
104
104
note: raw pointer dereference occurs here
105
- --> tests/ui/multiple_unsafe_ops_per_block.rs:68 :9
105
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:72 :9
106
106
|
107
107
LL | *raw_ptr();
108
108
| ^^^^^^^^^^
109
109
note: inline assembly used here
110
- --> tests/ui/multiple_unsafe_ops_per_block.rs:69 :9
110
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:73 :9
111
111
|
112
112
LL | asm!("nop");
113
113
| ^^^^^^^^^^^
114
114
115
115
error: this `unsafe` block contains 2 unsafe operations, expected only one
116
- --> tests/ui/multiple_unsafe_ops_per_block.rs:106 :9
116
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:110 :9
117
117
|
118
118
LL | unsafe { char::from_u32_unchecked(*ptr.cast::<u32>()) }
119
119
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
120
120
|
121
121
note: unsafe function call occurs here
122
- --> tests/ui/multiple_unsafe_ops_per_block.rs:106 :18
122
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:110 :18
123
123
|
124
124
LL | unsafe { char::from_u32_unchecked(*ptr.cast::<u32>()) }
125
125
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
126
126
note: raw pointer dereference occurs here
127
- --> tests/ui/multiple_unsafe_ops_per_block.rs:106 :43
127
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:110 :43
128
128
|
129
129
LL | unsafe { char::from_u32_unchecked(*ptr.cast::<u32>()) }
130
130
| ^^^^^^^^^^^^^^^^^^
131
131
132
132
error: this `unsafe` block contains 2 unsafe operations, expected only one
133
- --> tests/ui/multiple_unsafe_ops_per_block.rs:127 :9
133
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:131 :9
134
134
|
135
135
LL | / unsafe {
136
136
LL | |
@@ -140,18 +140,18 @@ LL | | }
140
140
| |_________^
141
141
|
142
142
note: unsafe function call occurs here
143
- --> tests/ui/multiple_unsafe_ops_per_block.rs:129 :13
143
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:133 :13
144
144
|
145
145
LL | x();
146
146
| ^^^
147
147
note: unsafe function call occurs here
148
- --> tests/ui/multiple_unsafe_ops_per_block.rs:130 :13
148
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:134 :13
149
149
|
150
150
LL | x();
151
151
| ^^^
152
152
153
153
error: this `unsafe` block contains 2 unsafe operations, expected only one
154
- --> tests/ui/multiple_unsafe_ops_per_block.rs:139 :13
154
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:143 :13
155
155
|
156
156
LL | / unsafe {
157
157
LL | |
@@ -161,18 +161,18 @@ LL | | }
161
161
| |_____________^
162
162
|
163
163
note: unsafe function call occurs here
164
- --> tests/ui/multiple_unsafe_ops_per_block.rs:141 :17
164
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:145 :17
165
165
|
166
166
LL | T::X();
167
167
| ^^^^^^
168
168
note: unsafe function call occurs here
169
- --> tests/ui/multiple_unsafe_ops_per_block.rs:142 :17
169
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:146 :17
170
170
|
171
171
LL | T::X();
172
172
| ^^^^^^
173
173
174
174
error: this `unsafe` block contains 2 unsafe operations, expected only one
175
- --> tests/ui/multiple_unsafe_ops_per_block.rs:150 :9
175
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:154 :9
176
176
|
177
177
LL | / unsafe {
178
178
LL | |
@@ -182,15 +182,78 @@ LL | | }
182
182
| |_________^
183
183
|
184
184
note: unsafe function call occurs here
185
- --> tests/ui/multiple_unsafe_ops_per_block.rs:152 :13
185
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:156 :13
186
186
|
187
187
LL | x.0();
188
188
| ^^^^^
189
189
note: unsafe function call occurs here
190
- --> tests/ui/multiple_unsafe_ops_per_block.rs:153 :13
190
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:157 :13
191
191
|
192
192
LL | x.0();
193
193
| ^^^^^
194
194
195
- error: aborting due to 8 previous errors
195
+ error: this `unsafe` block contains 2 unsafe operations, expected only one
196
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:184:5
197
+ |
198
+ LL | / unsafe {
199
+ LL | |
200
+ LL | | not_very_safe();
201
+ LL | | STATIC += 1;
202
+ LL | | foo().await;
203
+ LL | | }
204
+ | |_____^
205
+ |
206
+ note: unsafe function call occurs here
207
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:186:9
208
+ |
209
+ LL | not_very_safe();
210
+ | ^^^^^^^^^^^^^^^
211
+ note: modification of a mutable static occurs here
212
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:187:9
213
+ |
214
+ LL | STATIC += 1;
215
+ | ^^^^^^^^^^^
216
+
217
+ error: this `unsafe` block contains 2 unsafe operations, expected only one
218
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:199:5
219
+ |
220
+ LL | / unsafe {
221
+ LL | |
222
+ LL | | not_very_safe();
223
+ LL | | foo_unchecked().await;
224
+ LL | | }
225
+ | |_____^
226
+ |
227
+ note: unsafe function call occurs here
228
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:201:9
229
+ |
230
+ LL | not_very_safe();
231
+ | ^^^^^^^^^^^^^^^
232
+ note: unsafe function call occurs here
233
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:202:9
234
+ |
235
+ LL | foo_unchecked().await;
236
+ | ^^^^^^^^^^^^^^^
237
+
238
+ error: this `unsafe` block contains 2 unsafe operations, expected only one
239
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:206:5
240
+ |
241
+ LL | / unsafe {
242
+ LL | |
243
+ LL | | Some(foo_unchecked()).unwrap_unchecked().await;
244
+ LL | | }
245
+ | |_____^
246
+ |
247
+ note: unsafe method call occurs here
248
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:208:9
249
+ |
250
+ LL | Some(foo_unchecked()).unwrap_unchecked().await;
251
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
252
+ note: unsafe function call occurs here
253
+ --> tests/ui/multiple_unsafe_ops_per_block.rs:208:14
254
+ |
255
+ LL | Some(foo_unchecked()).unwrap_unchecked().await;
256
+ | ^^^^^^^^^^^^^^^
257
+
258
+ error: aborting due to 11 previous errors
196
259
0 commit comments