|
1 | 1 | error[E0080]: constructing invalid value: encountered a null reference
|
2 |
| - --> $DIR/forbidden_slices.rs:16:1 |
| 2 | + --> $DIR/forbidden_slices.rs:16:34 |
3 | 3 | |
|
4 | 4 | LL | pub static S0: &[u32] = unsafe { from_raw_parts(ptr::null(), 0) };
|
5 |
| - | ^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value |
6 |
| - | |
7 |
| - = 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. |
8 |
| - = note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) { |
9 |
| - HEX_DUMP |
10 |
| - } |
| 5 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `S0` failed here |
11 | 6 |
|
12 | 7 | error[E0080]: constructing invalid value: encountered a null reference
|
13 |
| - --> $DIR/forbidden_slices.rs:18:1 |
| 8 | + --> $DIR/forbidden_slices.rs:18:33 |
14 | 9 | |
|
15 | 10 | LL | pub static S1: &[()] = unsafe { from_raw_parts(ptr::null(), 0) };
|
16 |
| - | ^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value |
17 |
| - | |
18 |
| - = 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. |
19 |
| - = note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) { |
20 |
| - HEX_DUMP |
21 |
| - } |
| 11 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `S1` failed here |
22 | 12 |
|
23 | 13 | error[E0080]: constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation)
|
24 |
| - --> $DIR/forbidden_slices.rs:22:1 |
| 14 | + --> $DIR/forbidden_slices.rs:22:34 |
25 | 15 | |
|
26 | 16 | LL | pub static S2: &[u32] = unsafe { from_raw_parts(&D0, 2) };
|
27 |
| - | ^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value |
28 |
| - | |
29 |
| - = 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. |
30 |
| - = note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) { |
31 |
| - HEX_DUMP |
32 |
| - } |
| 17 | + | ^^^^^^^^^^^^^^^^^^^^^^ evaluation of `S2` failed here |
33 | 18 |
|
34 | 19 | error[E0080]: constructing invalid value at .<deref>[0]: encountered uninitialized memory, but expected an integer
|
35 | 20 | --> $DIR/forbidden_slices.rs:26:1
|
@@ -78,34 +63,24 @@ LL | pub static S7: &[u16] = unsafe {
|
78 | 63 | }
|
79 | 64 |
|
80 | 65 | error[E0080]: constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation)
|
81 |
| - --> $DIR/forbidden_slices.rs:41:1 |
| 66 | + --> $DIR/forbidden_slices.rs:44:5 |
82 | 67 | |
|
83 |
| -LL | pub static S8: &[u64] = unsafe { |
84 |
| - | ^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value |
85 |
| - | |
86 |
| - = 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. |
87 |
| - = note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) { |
88 |
| - HEX_DUMP |
89 |
| - } |
| 68 | +LL | from_raw_parts(ptr, 1) |
| 69 | + | ^^^^^^^^^^^^^^^^^^^^^^ evaluation of `S8` failed here |
90 | 70 |
|
91 | 71 | error[E0080]: constructing invalid value: encountered a null reference
|
92 |
| - --> $DIR/forbidden_slices.rs:48:1 |
| 72 | + --> $DIR/forbidden_slices.rs:48:34 |
93 | 73 | |
|
94 | 74 | LL | pub static R0: &[u32] = unsafe { from_ptr_range(ptr::null()..ptr::null()) };
|
95 |
| - | ^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value |
96 |
| - | |
97 |
| - = 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. |
98 |
| - = note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) { |
99 |
| - HEX_DUMP |
100 |
| - } |
| 75 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `R0` failed here |
101 | 76 |
|
102 | 77 | error[E0080]: evaluation panicked: assertion failed: 0 < pointee_size && pointee_size <= isize::MAX as usize
|
103 | 78 | --> $DIR/forbidden_slices.rs:50:33
|
104 | 79 | |
|
105 | 80 | LL | pub static R1: &[()] = unsafe { from_ptr_range(ptr::null()..ptr::null()) }; // errors inside libcore
|
106 | 81 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `R1` failed here
|
107 | 82 |
|
108 |
| -error[E0080]: in-bounds pointer arithmetic failed: attempting to offset pointer by 8 bytes, but got ALLOC10 which is only 4 bytes from the end of the allocation |
| 83 | +error[E0080]: in-bounds pointer arithmetic failed: attempting to offset pointer by 8 bytes, but got ALLOC7 which is only 4 bytes from the end of the allocation |
109 | 84 | --> $DIR/forbidden_slices.rs:54:25
|
110 | 85 | |
|
111 | 86 | LL | from_ptr_range(ptr..ptr.add(2)) // errors inside libcore
|
@@ -147,17 +122,12 @@ LL | pub static R6: &[bool] = unsafe {
|
147 | 122 | }
|
148 | 123 |
|
149 | 124 | error[E0080]: constructing invalid value: encountered an unaligned reference (required 2 byte alignment but found 1)
|
150 |
| - --> $DIR/forbidden_slices.rs:72:1 |
151 |
| - | |
152 |
| -LL | pub static R7: &[u16] = unsafe { |
153 |
| - | ^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value |
| 125 | + --> $DIR/forbidden_slices.rs:74:5 |
154 | 126 | |
|
155 |
| - = 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. |
156 |
| - = note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) { |
157 |
| - HEX_DUMP |
158 |
| - } |
| 127 | +LL | from_ptr_range(ptr..ptr.add(4)) |
| 128 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `R7` failed here |
159 | 129 |
|
160 |
| -error[E0080]: in-bounds pointer arithmetic failed: attempting to offset pointer by 8 bytes, but got ALLOC11+0x1 which is only 7 bytes from the end of the allocation |
| 130 | +error[E0080]: in-bounds pointer arithmetic failed: attempting to offset pointer by 8 bytes, but got ALLOC8+0x1 which is only 7 bytes from the end of the allocation |
161 | 131 | --> $DIR/forbidden_slices.rs:79:25
|
162 | 132 | |
|
163 | 133 | LL | from_ptr_range(ptr..ptr.add(1))
|
|
0 commit comments