1
1
warning: calls to `std::str::from_utf8_unchecked_mut` with an invalid literal are undefined behavior
2
- --> $DIR/invalid_from_utf8.rs:22 :9
2
+ --> $DIR/invalid_from_utf8.rs:21 :9
3
3
|
4
4
LL | std::str::from_utf8_unchecked_mut(&mut [99, 108, 130, 105, 112, 112, 121]);
5
5
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^----------------------------------^
6
6
| |
7
7
| the literal was valid UTF-8 up to the 2 bytes
8
8
|
9
9
note: the lint level is defined here
10
- --> $DIR/invalid_from_utf8.rs:5 :9
10
+ --> $DIR/invalid_from_utf8.rs:4 :9
11
11
|
12
12
LL | #![warn(invalid_from_utf8_unchecked)]
13
13
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
14
14
15
15
warning: calls to `str::from_utf8_unchecked_mut` with an invalid literal are undefined behavior
16
- --> $DIR/invalid_from_utf8.rs:24 :9
16
+ --> $DIR/invalid_from_utf8.rs:23 :9
17
17
|
18
18
LL | str::from_utf8_unchecked_mut(&mut [99, 108, 130, 105, 112, 112, 121]);
19
19
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^----------------------------------^
20
20
| |
21
21
| the literal was valid UTF-8 up to the 2 bytes
22
22
23
23
warning: calls to `std::str::from_utf8_unchecked_mut` with an invalid literal are undefined behavior
24
- --> $DIR/invalid_from_utf8.rs:26 :9
24
+ --> $DIR/invalid_from_utf8.rs:25 :9
25
25
|
26
26
LL | std::str::from_utf8_unchecked_mut(&mut [b'c', b'l', b'\x82', b'i', b'p', b'p', b'y']);
27
27
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------------------------------------------^
28
28
| |
29
29
| the literal was valid UTF-8 up to the 2 bytes
30
30
31
31
warning: calls to `str::from_utf8_unchecked_mut` with an invalid literal are undefined behavior
32
- --> $DIR/invalid_from_utf8.rs:28 :9
32
+ --> $DIR/invalid_from_utf8.rs:27 :9
33
33
|
34
34
LL | str::from_utf8_unchecked_mut(&mut [b'c', b'l', b'\x82', b'i', b'p', b'p', b'y']);
35
35
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------------------------------------------^
36
36
| |
37
37
| the literal was valid UTF-8 up to the 2 bytes
38
38
39
39
warning: calls to `std::str::from_utf8_unchecked` with an invalid literal are undefined behavior
40
- --> $DIR/invalid_from_utf8.rs:50 :9
40
+ --> $DIR/invalid_from_utf8.rs:49 :9
41
41
|
42
42
LL | std::str::from_utf8_unchecked(&[99, 108, 130, 105, 112, 112, 121]);
43
43
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^----------------------------------^
44
44
| |
45
45
| the literal was valid UTF-8 up to the 2 bytes
46
46
47
47
warning: calls to `str::from_utf8_unchecked` with an invalid literal are undefined behavior
48
- --> $DIR/invalid_from_utf8.rs:52 :9
48
+ --> $DIR/invalid_from_utf8.rs:51 :9
49
49
|
50
50
LL | str::from_utf8_unchecked(&[99, 108, 130, 105, 112, 112, 121]);
51
51
| ^^^^^^^^^^^^^^^^^^^^^^^^^^----------------------------------^
52
52
| |
53
53
| the literal was valid UTF-8 up to the 2 bytes
54
54
55
55
warning: calls to `std::str::from_utf8_unchecked` with an invalid literal are undefined behavior
56
- --> $DIR/invalid_from_utf8.rs:54 :9
56
+ --> $DIR/invalid_from_utf8.rs:53 :9
57
57
|
58
58
LL | std::str::from_utf8_unchecked(&[b'c', b'l', b'\x82', b'i', b'p', b'p', b'y']);
59
59
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------------------------------------------^
60
60
| |
61
61
| the literal was valid UTF-8 up to the 2 bytes
62
62
63
63
warning: calls to `str::from_utf8_unchecked` with an invalid literal are undefined behavior
64
- --> $DIR/invalid_from_utf8.rs:56 :9
64
+ --> $DIR/invalid_from_utf8.rs:55 :9
65
65
|
66
66
LL | str::from_utf8_unchecked(&[b'c', b'l', b'\x82', b'i', b'p', b'p', b'y']);
67
67
| ^^^^^^^^^^^^^^^^^^^^^^^^^^---------------------------------------------^
68
68
| |
69
69
| the literal was valid UTF-8 up to the 2 bytes
70
70
71
71
warning: calls to `std::str::from_utf8_unchecked` with an invalid literal are undefined behavior
72
- --> $DIR/invalid_from_utf8.rs:58 :9
72
+ --> $DIR/invalid_from_utf8.rs:57 :9
73
73
|
74
74
LL | std::str::from_utf8_unchecked(b"cl\x82ippy");
75
75
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-------------^
76
76
| |
77
77
| the literal was valid UTF-8 up to the 2 bytes
78
78
79
79
warning: calls to `str::from_utf8_unchecked` with an invalid literal are undefined behavior
80
- --> $DIR/invalid_from_utf8.rs:60 :9
80
+ --> $DIR/invalid_from_utf8.rs:59 :9
81
81
|
82
82
LL | str::from_utf8_unchecked(b"cl\x82ippy");
83
83
| ^^^^^^^^^^^^^^^^^^^^^^^^^-------------^
84
84
| |
85
85
| the literal was valid UTF-8 up to the 2 bytes
86
86
87
87
warning: calls to `std::str::from_utf8_unchecked` with an invalid literal are undefined behavior
88
- --> $DIR/invalid_from_utf8.rs:62 :9
88
+ --> $DIR/invalid_from_utf8.rs:61 :9
89
89
|
90
90
LL | std::str::from_utf8_unchecked(concat_bytes!(b"cl", b"\x82ippy"));
91
91
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------------------------------^
92
92
| |
93
93
| the literal was valid UTF-8 up to the 2 bytes
94
94
95
95
warning: calls to `str::from_utf8_unchecked` with an invalid literal are undefined behavior
96
- --> $DIR/invalid_from_utf8.rs:64 :9
96
+ --> $DIR/invalid_from_utf8.rs:63 :9
97
97
|
98
98
LL | str::from_utf8_unchecked(concat_bytes!(b"cl", b"\x82ippy"));
99
99
| ^^^^^^^^^^^^^^^^^^^^^^^^^---------------------------------^
100
100
| |
101
101
| the literal was valid UTF-8 up to the 2 bytes
102
102
103
103
warning: calls to `std::str::from_utf8_mut` with an invalid literal always return an error
104
- --> $DIR/invalid_from_utf8.rs:84 :9
104
+ --> $DIR/invalid_from_utf8.rs:83 :9
105
105
|
106
106
LL | std::str::from_utf8_mut(&mut [99, 108, 130, 105, 112, 112, 121]);
107
107
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^----------------------------------^
108
108
| |
109
109
| the literal was valid UTF-8 up to the 2 bytes
110
110
|
111
111
note: the lint level is defined here
112
- --> $DIR/invalid_from_utf8.rs:6 :9
112
+ --> $DIR/invalid_from_utf8.rs:5 :9
113
113
|
114
114
LL | #![warn(invalid_from_utf8)]
115
115
| ^^^^^^^^^^^^^^^^^
116
116
117
117
warning: calls to `str::from_utf8_mut` with an invalid literal always return an error
118
- --> $DIR/invalid_from_utf8.rs:86 :9
118
+ --> $DIR/invalid_from_utf8.rs:85 :9
119
119
|
120
120
LL | str::from_utf8_mut(&mut [99, 108, 130, 105, 112, 112, 121]);
121
121
| ^^^^^^^^^^^^^^^^^^^^^^^^----------------------------------^
122
122
| |
123
123
| the literal was valid UTF-8 up to the 2 bytes
124
124
125
125
warning: calls to `std::str::from_utf8_mut` with an invalid literal always return an error
126
- --> $DIR/invalid_from_utf8.rs:88 :9
126
+ --> $DIR/invalid_from_utf8.rs:87 :9
127
127
|
128
128
LL | std::str::from_utf8_mut(&mut [b'c', b'l', b'\x82', b'i', b'p', b'p', b'y']);
129
129
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------------------------------------------^
130
130
| |
131
131
| the literal was valid UTF-8 up to the 2 bytes
132
132
133
133
warning: calls to `str::from_utf8_mut` with an invalid literal always return an error
134
- --> $DIR/invalid_from_utf8.rs:90 :9
134
+ --> $DIR/invalid_from_utf8.rs:89 :9
135
135
|
136
136
LL | str::from_utf8_mut(&mut [b'c', b'l', b'\x82', b'i', b'p', b'p', b'y']);
137
137
| ^^^^^^^^^^^^^^^^^^^^^^^^---------------------------------------------^
138
138
| |
139
139
| the literal was valid UTF-8 up to the 2 bytes
140
140
141
141
warning: calls to `std::str::from_utf8` with an invalid literal always return an error
142
- --> $DIR/invalid_from_utf8.rs:112 :9
142
+ --> $DIR/invalid_from_utf8.rs:111 :9
143
143
|
144
144
LL | std::str::from_utf8(&[99, 108, 130, 105, 112, 112, 121]);
145
145
| ^^^^^^^^^^^^^^^^^^^^^----------------------------------^
146
146
| |
147
147
| the literal was valid UTF-8 up to the 2 bytes
148
148
149
149
warning: calls to `str::from_utf8` with an invalid literal always return an error
150
- --> $DIR/invalid_from_utf8.rs:114 :9
150
+ --> $DIR/invalid_from_utf8.rs:113 :9
151
151
|
152
152
LL | str::from_utf8(&[99, 108, 130, 105, 112, 112, 121]);
153
153
| ^^^^^^^^^^^^^^^^----------------------------------^
154
154
| |
155
155
| the literal was valid UTF-8 up to the 2 bytes
156
156
157
157
warning: calls to `std::str::from_utf8` with an invalid literal always return an error
158
- --> $DIR/invalid_from_utf8.rs:116 :9
158
+ --> $DIR/invalid_from_utf8.rs:115 :9
159
159
|
160
160
LL | std::str::from_utf8(&[b'c', b'l', b'\x82', b'i', b'p', b'p', b'y']);
161
161
| ^^^^^^^^^^^^^^^^^^^^^---------------------------------------------^
162
162
| |
163
163
| the literal was valid UTF-8 up to the 2 bytes
164
164
165
165
warning: calls to `str::from_utf8` with an invalid literal always return an error
166
- --> $DIR/invalid_from_utf8.rs:118 :9
166
+ --> $DIR/invalid_from_utf8.rs:117 :9
167
167
|
168
168
LL | str::from_utf8(&[b'c', b'l', b'\x82', b'i', b'p', b'p', b'y']);
169
169
| ^^^^^^^^^^^^^^^^---------------------------------------------^
170
170
| |
171
171
| the literal was valid UTF-8 up to the 2 bytes
172
172
173
173
warning: calls to `std::str::from_utf8` with an invalid literal always return an error
174
- --> $DIR/invalid_from_utf8.rs:120 :9
174
+ --> $DIR/invalid_from_utf8.rs:119 :9
175
175
|
176
176
LL | std::str::from_utf8(b"cl\x82ippy");
177
177
| ^^^^^^^^^^^^^^^^^^^^-------------^
178
178
| |
179
179
| the literal was valid UTF-8 up to the 2 bytes
180
180
181
181
warning: calls to `str::from_utf8` with an invalid literal always return an error
182
- --> $DIR/invalid_from_utf8.rs:122 :9
182
+ --> $DIR/invalid_from_utf8.rs:121 :9
183
183
|
184
184
LL | str::from_utf8(b"cl\x82ippy");
185
185
| ^^^^^^^^^^^^^^^-------------^
186
186
| |
187
187
| the literal was valid UTF-8 up to the 2 bytes
188
188
189
189
warning: calls to `std::str::from_utf8` with an invalid literal always return an error
190
- --> $DIR/invalid_from_utf8.rs:124 :9
190
+ --> $DIR/invalid_from_utf8.rs:123 :9
191
191
|
192
192
LL | std::str::from_utf8(concat_bytes!(b"cl", b"\x82ippy"));
193
193
| ^^^^^^^^^^^^^^^^^^^^---------------------------------^
194
194
| |
195
195
| the literal was valid UTF-8 up to the 2 bytes
196
196
197
197
warning: calls to `str::from_utf8` with an invalid literal always return an error
198
- --> $DIR/invalid_from_utf8.rs:126 :9
198
+ --> $DIR/invalid_from_utf8.rs:125 :9
199
199
|
200
200
LL | str::from_utf8(concat_bytes!(b"cl", b"\x82ippy"));
201
201
| ^^^^^^^^^^^^^^^---------------------------------^
202
202
| |
203
203
| the literal was valid UTF-8 up to the 2 bytes
204
204
205
205
warning: calls to `std::str::from_utf8_mut` with an invalid literal always return an error
206
- --> $DIR/invalid_from_utf8.rs:133 :5
206
+ --> $DIR/invalid_from_utf8.rs:132 :5
207
207
|
208
208
LL | let mut a = [99, 108, 130, 105, 112, 112, 121];
209
209
| ---------------------------------- the literal was valid UTF-8 up to the 2 bytes
210
210
LL | std::str::from_utf8_mut(&mut a);
211
211
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
212
212
213
213
warning: calls to `str::from_utf8_mut` with an invalid literal always return an error
214
- --> $DIR/invalid_from_utf8.rs:135 :5
214
+ --> $DIR/invalid_from_utf8.rs:134 :5
215
215
|
216
216
LL | let mut a = [99, 108, 130, 105, 112, 112, 121];
217
217
| ---------------------------------- the literal was valid UTF-8 up to the 2 bytes
@@ -220,7 +220,7 @@ LL | str::from_utf8_mut(&mut a);
220
220
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
221
221
222
222
warning: calls to `std::str::from_utf8_mut` with an invalid literal always return an error
223
- --> $DIR/invalid_from_utf8.rs:139 :5
223
+ --> $DIR/invalid_from_utf8.rs:138 :5
224
224
|
225
225
LL | let mut a = [99, 108, 130, 105, 112, 112, 121];
226
226
| ---------------------------------- the literal was valid UTF-8 up to the 2 bytes
@@ -229,7 +229,7 @@ LL | std::str::from_utf8_mut(c);
229
229
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
230
230
231
231
warning: calls to `str::from_utf8_mut` with an invalid literal always return an error
232
- --> $DIR/invalid_from_utf8.rs:141 :5
232
+ --> $DIR/invalid_from_utf8.rs:140 :5
233
233
|
234
234
LL | let mut a = [99, 108, 130, 105, 112, 112, 121];
235
235
| ---------------------------------- the literal was valid UTF-8 up to the 2 bytes
@@ -238,15 +238,15 @@ LL | str::from_utf8_mut(c);
238
238
| ^^^^^^^^^^^^^^^^^^^^^
239
239
240
240
warning: calls to `std::str::from_utf8` with an invalid literal always return an error
241
- --> $DIR/invalid_from_utf8.rs:144 :5
241
+ --> $DIR/invalid_from_utf8.rs:143 :5
242
242
|
243
243
LL | let mut c = &[99, 108, 130, 105, 112, 112, 121];
244
244
| ---------------------------------- the literal was valid UTF-8 up to the 2 bytes
245
245
LL | std::str::from_utf8(c);
246
246
| ^^^^^^^^^^^^^^^^^^^^^^
247
247
248
248
warning: calls to `str::from_utf8` with an invalid literal always return an error
249
- --> $DIR/invalid_from_utf8.rs:146 :5
249
+ --> $DIR/invalid_from_utf8.rs:145 :5
250
250
|
251
251
LL | let mut c = &[99, 108, 130, 105, 112, 112, 121];
252
252
| ---------------------------------- the literal was valid UTF-8 up to the 2 bytes
@@ -255,15 +255,15 @@ LL | str::from_utf8(c);
255
255
| ^^^^^^^^^^^^^^^^^
256
256
257
257
warning: calls to `std::str::from_utf8` with an invalid literal always return an error
258
- --> $DIR/invalid_from_utf8.rs:149 :5
258
+ --> $DIR/invalid_from_utf8.rs:148 :5
259
259
|
260
260
LL | const INVALID_1: [u8; 7] = [99, 108, 130, 105, 112, 112, 121];
261
261
| ---------------------------------- the literal was valid UTF-8 up to the 2 bytes
262
262
LL | std::str::from_utf8(&INVALID_1);
263
263
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
264
264
265
265
warning: calls to `str::from_utf8` with an invalid literal always return an error
266
- --> $DIR/invalid_from_utf8.rs:151 :5
266
+ --> $DIR/invalid_from_utf8.rs:150 :5
267
267
|
268
268
LL | const INVALID_1: [u8; 7] = [99, 108, 130, 105, 112, 112, 121];
269
269
| ---------------------------------- the literal was valid UTF-8 up to the 2 bytes
@@ -272,15 +272,15 @@ LL | str::from_utf8(&INVALID_1);
272
272
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
273
273
274
274
warning: calls to `std::str::from_utf8` with an invalid literal always return an error
275
- --> $DIR/invalid_from_utf8.rs:154 :5
275
+ --> $DIR/invalid_from_utf8.rs:153 :5
276
276
|
277
277
LL | static INVALID_2: [u8; 7] = [99, 108, 130, 105, 112, 112, 121];
278
278
| ---------------------------------- the literal was valid UTF-8 up to the 2 bytes
279
279
LL | std::str::from_utf8(&INVALID_2);
280
280
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
281
281
282
282
warning: calls to `str::from_utf8` with an invalid literal always return an error
283
- --> $DIR/invalid_from_utf8.rs:156 :5
283
+ --> $DIR/invalid_from_utf8.rs:155 :5
284
284
|
285
285
LL | static INVALID_2: [u8; 7] = [99, 108, 130, 105, 112, 112, 121];
286
286
| ---------------------------------- the literal was valid UTF-8 up to the 2 bytes
@@ -289,15 +289,15 @@ LL | str::from_utf8(&INVALID_2);
289
289
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
290
290
291
291
warning: calls to `std::str::from_utf8` with an invalid literal always return an error
292
- --> $DIR/invalid_from_utf8.rs:159 :5
292
+ --> $DIR/invalid_from_utf8.rs:158 :5
293
293
|
294
294
LL | const INVALID_3: &'static [u8; 7] = &[99, 108, 130, 105, 112, 112, 121];
295
295
| ---------------------------------- the literal was valid UTF-8 up to the 2 bytes
296
296
LL | std::str::from_utf8(INVALID_3);
297
297
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
298
298
299
299
warning: calls to `str::from_utf8` with an invalid literal always return an error
300
- --> $DIR/invalid_from_utf8.rs:161 :5
300
+ --> $DIR/invalid_from_utf8.rs:160 :5
301
301
|
302
302
LL | const INVALID_3: &'static [u8; 7] = &[99, 108, 130, 105, 112, 112, 121];
303
303
| ---------------------------------- the literal was valid UTF-8 up to the 2 bytes
@@ -306,15 +306,15 @@ LL | str::from_utf8(INVALID_3);
306
306
| ^^^^^^^^^^^^^^^^^^^^^^^^^
307
307
308
308
warning: calls to `std::str::from_utf8` with an invalid literal always return an error
309
- --> $DIR/invalid_from_utf8.rs:164 :5
309
+ --> $DIR/invalid_from_utf8.rs:163 :5
310
310
|
311
311
LL | const INVALID_4: &'static [u8; 7] = { &[99, 108, 130, 105, 112, 112, 121] };
312
312
| ---------------------------------- the literal was valid UTF-8 up to the 2 bytes
313
313
LL | std::str::from_utf8(INVALID_4);
314
314
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
315
315
316
316
warning: calls to `str::from_utf8` with an invalid literal always return an error
317
- --> $DIR/invalid_from_utf8.rs:166 :5
317
+ --> $DIR/invalid_from_utf8.rs:165 :5
318
318
|
319
319
LL | const INVALID_4: &'static [u8; 7] = { &[99, 108, 130, 105, 112, 112, 121] };
320
320
| ---------------------------------- the literal was valid UTF-8 up to the 2 bytes
0 commit comments