|
1 | 1 | warning: calls to `std::str::from_utf8_unchecked_mut` with a invalid literal are undefined behavior
|
2 |
| - --> $DIR/invalid_from_utf8.rs:19: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 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------------------------------------^ |
6 |
| - | | |
7 |
| - | the literal was valid UTF-8 up to the 2 bytes |
| 5 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^----------------------------------^ |
| 6 | + | | |
| 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:4:9 |
| 10 | + --> $DIR/invalid_from_utf8.rs:6:9 |
11 | 11 | |
|
12 | 12 | LL | #![warn(invalid_from_utf8_unchecked)]
|
13 | 13 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
14 | 14 |
|
15 | 15 | warning: calls to `std::str::from_utf8_unchecked_mut` with a invalid literal are undefined behavior
|
16 |
| - --> $DIR/invalid_from_utf8.rs:21:9 |
| 16 | + --> $DIR/invalid_from_utf8.rs:23:9 |
17 | 17 | |
|
18 | 18 | LL | std::str::from_utf8_unchecked_mut(&mut [b'c', b'l', b'\x82', b'i', b'p', b'p', b'y']);
|
19 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--------------------------------------------------^ |
20 |
| - | | |
21 |
| - | the literal was valid UTF-8 up to the 2 bytes |
| 19 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------------------------------------------^ |
| 20 | + | | |
| 21 | + | the literal was valid UTF-8 up to the 2 bytes |
22 | 22 |
|
23 | 23 | warning: calls to `std::str::from_utf8_unchecked` with a invalid literal are undefined behavior
|
24 |
| - --> $DIR/invalid_from_utf8.rs:39:9 |
| 24 | + --> $DIR/invalid_from_utf8.rs:41:9 |
25 | 25 | |
|
26 | 26 | LL | std::str::from_utf8_unchecked(&[99, 108, 130, 105, 112, 112, 121]);
|
27 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-----------------------------------^ |
28 |
| - | | |
29 |
| - | the literal was valid UTF-8 up to the 2 bytes |
| 27 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^----------------------------------^ |
| 28 | + | | |
| 29 | + | the literal was valid UTF-8 up to the 2 bytes |
30 | 30 |
|
31 | 31 | warning: calls to `std::str::from_utf8_unchecked` with a invalid literal are undefined behavior
|
32 |
| - --> $DIR/invalid_from_utf8.rs:41:9 |
| 32 | + --> $DIR/invalid_from_utf8.rs:43:9 |
33 | 33 | |
|
34 | 34 | LL | std::str::from_utf8_unchecked(&[b'c', b'l', b'\x82', b'i', b'p', b'p', b'y']);
|
35 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^----------------------------------------------^ |
36 |
| - | | |
37 |
| - | the literal was valid UTF-8 up to the 2 bytes |
| 35 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------------------------------------------^ |
| 36 | + | | |
| 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 a invalid literal are undefined behavior
|
40 |
| - --> $DIR/invalid_from_utf8.rs:43:9 |
| 40 | + --> $DIR/invalid_from_utf8.rs:45:9 |
41 | 41 | |
|
42 | 42 | LL | std::str::from_utf8_unchecked(b"cl\x82ippy");
|
43 | 43 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-------------^
|
44 | 44 | | |
|
45 | 45 | | the literal was valid UTF-8 up to the 2 bytes
|
46 | 46 |
|
47 | 47 | warning: calls to `std::str::from_utf8_unchecked` with a invalid literal are undefined behavior
|
48 |
| - --> $DIR/invalid_from_utf8.rs:45:9 |
| 48 | + --> $DIR/invalid_from_utf8.rs:47:9 |
49 | 49 | |
|
50 | 50 | LL | std::str::from_utf8_unchecked(concat_bytes!(b"cl", b"\x82ippy"));
|
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_mut` with a invalid literal always return an error
|
56 |
| - --> $DIR/invalid_from_utf8.rs:62:9 |
| 56 | + --> $DIR/invalid_from_utf8.rs:64:9 |
57 | 57 | |
|
58 | 58 | LL | std::str::from_utf8_mut(&mut [99, 108, 130, 105, 112, 112, 121]);
|
59 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^---------------------------------------^ |
60 |
| - | | |
61 |
| - | the literal was valid UTF-8 up to the 2 bytes |
| 59 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^----------------------------------^ |
| 60 | + | | |
| 61 | + | the literal was valid UTF-8 up to the 2 bytes |
62 | 62 | |
|
63 | 63 | note: the lint level is defined here
|
64 |
| - --> $DIR/invalid_from_utf8.rs:5:9 |
| 64 | + --> $DIR/invalid_from_utf8.rs:7:9 |
65 | 65 | |
|
66 | 66 | LL | #![warn(invalid_from_utf8)]
|
67 | 67 | | ^^^^^^^^^^^^^^^^^
|
68 | 68 |
|
69 | 69 | warning: calls to `std::str::from_utf8_mut` with a invalid literal always return an error
|
70 |
| - --> $DIR/invalid_from_utf8.rs:64:9 |
| 70 | + --> $DIR/invalid_from_utf8.rs:66:9 |
71 | 71 | |
|
72 | 72 | LL | std::str::from_utf8_mut(&mut [b'c', b'l', b'\x82', b'i', b'p', b'p', b'y']);
|
73 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^--------------------------------------------------^ |
74 |
| - | | |
75 |
| - | the literal was valid UTF-8 up to the 2 bytes |
| 73 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------------------------------------------^ |
| 74 | + | | |
| 75 | + | the literal was valid UTF-8 up to the 2 bytes |
76 | 76 |
|
77 | 77 | warning: calls to `std::str::from_utf8` with a invalid literal always return an error
|
78 |
| - --> $DIR/invalid_from_utf8.rs:82:9 |
| 78 | + --> $DIR/invalid_from_utf8.rs:84:9 |
79 | 79 | |
|
80 | 80 | LL | std::str::from_utf8(&[99, 108, 130, 105, 112, 112, 121]);
|
81 |
| - | ^^^^^^^^^^^^^^^^^^^^-----------------------------------^ |
82 |
| - | | |
83 |
| - | the literal was valid UTF-8 up to the 2 bytes |
| 81 | + | ^^^^^^^^^^^^^^^^^^^^^----------------------------------^ |
| 82 | + | | |
| 83 | + | the literal was valid UTF-8 up to the 2 bytes |
84 | 84 |
|
85 | 85 | warning: calls to `std::str::from_utf8` with a invalid literal always return an error
|
86 |
| - --> $DIR/invalid_from_utf8.rs:84:9 |
| 86 | + --> $DIR/invalid_from_utf8.rs:86:9 |
87 | 87 | |
|
88 | 88 | LL | std::str::from_utf8(&[b'c', b'l', b'\x82', b'i', b'p', b'p', b'y']);
|
89 |
| - | ^^^^^^^^^^^^^^^^^^^^----------------------------------------------^ |
90 |
| - | | |
91 |
| - | the literal was valid UTF-8 up to the 2 bytes |
| 89 | + | ^^^^^^^^^^^^^^^^^^^^^---------------------------------------------^ |
| 90 | + | | |
| 91 | + | the literal was valid UTF-8 up to the 2 bytes |
92 | 92 |
|
93 | 93 | warning: calls to `std::str::from_utf8` with a invalid literal always return an error
|
94 |
| - --> $DIR/invalid_from_utf8.rs:86:9 |
| 94 | + --> $DIR/invalid_from_utf8.rs:88:9 |
95 | 95 | |
|
96 | 96 | LL | std::str::from_utf8(b"cl\x82ippy");
|
97 | 97 | | ^^^^^^^^^^^^^^^^^^^^-------------^
|
98 | 98 | | |
|
99 | 99 | | the literal was valid UTF-8 up to the 2 bytes
|
100 | 100 |
|
101 | 101 | warning: calls to `std::str::from_utf8` with a invalid literal always return an error
|
102 |
| - --> $DIR/invalid_from_utf8.rs:88:9 |
| 102 | + --> $DIR/invalid_from_utf8.rs:90:9 |
103 | 103 | |
|
104 | 104 | LL | std::str::from_utf8(concat_bytes!(b"cl", b"\x82ippy"));
|
105 | 105 | | ^^^^^^^^^^^^^^^^^^^^---------------------------------^
|
106 | 106 | | |
|
107 | 107 | | the literal was valid UTF-8 up to the 2 bytes
|
108 | 108 |
|
109 |
| -warning: 12 warnings emitted |
| 109 | +warning: calls to `std::str::from_utf8_mut` with a invalid literal always return an error |
| 110 | + --> $DIR/invalid_from_utf8.rs:97:5 |
| 111 | + | |
| 112 | +LL | let mut a = [99, 108, 130, 105, 112, 112, 121]; |
| 113 | + | ---------------------------------- the literal was valid UTF-8 up to the 2 bytes |
| 114 | +LL | std::str::from_utf8_mut(&mut a); |
| 115 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 116 | + |
| 117 | +warning: calls to `std::str::from_utf8_mut` with a invalid literal always return an error |
| 118 | + --> $DIR/invalid_from_utf8.rs:101:5 |
| 119 | + | |
| 120 | +LL | let mut a = [99, 108, 130, 105, 112, 112, 121]; |
| 121 | + | ---------------------------------- the literal was valid UTF-8 up to the 2 bytes |
| 122 | +... |
| 123 | +LL | std::str::from_utf8_mut(c); |
| 124 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 125 | + |
| 126 | +warning: calls to `std::str::from_utf8` with a invalid literal always return an error |
| 127 | + --> $DIR/invalid_from_utf8.rs:104:5 |
| 128 | + | |
| 129 | +LL | let mut c = &[99, 108, 130, 105, 112, 112, 121]; |
| 130 | + | ---------------------------------- the literal was valid UTF-8 up to the 2 bytes |
| 131 | +LL | std::str::from_utf8(c); |
| 132 | + | ^^^^^^^^^^^^^^^^^^^^^^ |
| 133 | + |
| 134 | +warning: calls to `std::str::from_utf8` with a invalid literal always return an error |
| 135 | + --> $DIR/invalid_from_utf8.rs:107:5 |
| 136 | + | |
| 137 | +LL | const INVALID_1: [u8; 7] = [99, 108, 130, 105, 112, 112, 121]; |
| 138 | + | ---------------------------------- the literal was valid UTF-8 up to the 2 bytes |
| 139 | +LL | std::str::from_utf8(&INVALID_1); |
| 140 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 141 | + |
| 142 | +warning: calls to `std::str::from_utf8` with a invalid literal always return an error |
| 143 | + --> $DIR/invalid_from_utf8.rs:110:5 |
| 144 | + | |
| 145 | +LL | static INVALID_2: [u8; 7] = [99, 108, 130, 105, 112, 112, 121]; |
| 146 | + | ---------------------------------- the literal was valid UTF-8 up to the 2 bytes |
| 147 | +LL | std::str::from_utf8(&INVALID_2); |
| 148 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 149 | + |
| 150 | +warning: calls to `std::str::from_utf8` with a invalid literal always return an error |
| 151 | + --> $DIR/invalid_from_utf8.rs:113:5 |
| 152 | + | |
| 153 | +LL | const INVALID_3: &'static [u8; 7] = &[99, 108, 130, 105, 112, 112, 121]; |
| 154 | + | ---------------------------------- the literal was valid UTF-8 up to the 2 bytes |
| 155 | +LL | std::str::from_utf8(INVALID_3); |
| 156 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 157 | + |
| 158 | +warning: calls to `std::str::from_utf8` with a invalid literal always return an error |
| 159 | + --> $DIR/invalid_from_utf8.rs:116:5 |
| 160 | + | |
| 161 | +LL | const INVALID_4: &'static [u8; 7] = { &[99, 108, 130, 105, 112, 112, 121] }; |
| 162 | + | ---------------------------------- the literal was valid UTF-8 up to the 2 bytes |
| 163 | +LL | std::str::from_utf8(INVALID_4); |
| 164 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 165 | + |
| 166 | +warning: 19 warnings emitted |
110 | 167 |
|
0 commit comments