Skip to content

Commit 6a7a652

Browse files
Bless failing tests
1 parent a1623ff commit 6a7a652

File tree

4 files changed

+105
-99
lines changed

4 files changed

+105
-99
lines changed

src/test/ui/consts/miri_unleashed/drop.stderr

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ error[E0080]: could not evaluate static initializer
44
LL | / pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {
55
LL | | // Code here does not matter - this is replaced by the
66
LL | | // real drop glue by the compiler.
7-
LL | | drop_in_place(to_drop)
7+
LL | |
8+
LL | | // SAFETY: see comment above
9+
LL | | unsafe { drop_in_place(to_drop) }
810
LL | | }
911
| | ^
1012
| | |

src/test/ui/consts/offset_from_ub.stderr

+30-30
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
error: any use of this value will cause an error
22
--> $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
33
|
4-
LL | intrinsics::ptr_offset_from(self, origin)
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6-
| |
7-
| ptr_offset_from cannot compute offset of pointers into different allocations.
8-
| inside `std::ptr::const_ptr::<impl *const Struct>::offset_from` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
9-
| inside `DIFFERENT_ALLOC` at $DIR/offset_from_ub.rs:17:27
4+
LL | unsafe { intrinsics::ptr_offset_from(self, origin) }
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6+
| |
7+
| ptr_offset_from cannot compute offset of pointers into different allocations.
8+
| inside `std::ptr::const_ptr::<impl *const Struct>::offset_from` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
9+
| inside `DIFFERENT_ALLOC` at $DIR/offset_from_ub.rs:17:27
1010
|
1111
::: $DIR/offset_from_ub.rs:11:1
1212
|
@@ -24,12 +24,12 @@ LL | | };
2424
error: any use of this value will cause an error
2525
--> $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
2626
|
27-
LL | intrinsics::ptr_offset_from(self, origin)
28-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
29-
| |
30-
| unable to turn bytes into a pointer
31-
| inside `std::ptr::const_ptr::<impl *const u8>::offset_from` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
32-
| inside `NOT_PTR` at $DIR/offset_from_ub.rs:23:14
27+
LL | unsafe { intrinsics::ptr_offset_from(self, origin) }
28+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
29+
| |
30+
| unable to turn bytes into a pointer
31+
| inside `std::ptr::const_ptr::<impl *const u8>::offset_from` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
32+
| inside `NOT_PTR` at $DIR/offset_from_ub.rs:23:14
3333
|
3434
::: $DIR/offset_from_ub.rs:21:1
3535
|
@@ -42,12 +42,12 @@ LL | | };
4242
error: any use of this value will cause an error
4343
--> $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
4444
|
45-
LL | intrinsics::ptr_offset_from(self, origin)
46-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
47-
| |
48-
| exact_div: 1_isize cannot be divided by 2_isize without remainder
49-
| inside `std::ptr::const_ptr::<impl *const u16>::offset_from` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
50-
| inside `NOT_MULTIPLE_OF_SIZE` at $DIR/offset_from_ub.rs:31:14
45+
LL | unsafe { intrinsics::ptr_offset_from(self, origin) }
46+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
47+
| |
48+
| exact_div: 1_isize cannot be divided by 2_isize without remainder
49+
| inside `std::ptr::const_ptr::<impl *const u16>::offset_from` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
50+
| inside `NOT_MULTIPLE_OF_SIZE` at $DIR/offset_from_ub.rs:31:14
5151
|
5252
::: $DIR/offset_from_ub.rs:26:1
5353
|
@@ -63,12 +63,12 @@ LL | | };
6363
error: any use of this value will cause an error
6464
--> $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
6565
|
66-
LL | intrinsics::ptr_offset_from(self, origin)
67-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
68-
| |
69-
| inbounds test failed: 0x0 is not a valid pointer
70-
| inside `std::ptr::const_ptr::<impl *const u8>::offset_from` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
71-
| inside `OFFSET_FROM_NULL` at $DIR/offset_from_ub.rs:37:14
66+
LL | unsafe { intrinsics::ptr_offset_from(self, origin) }
67+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
68+
| |
69+
| inbounds test failed: 0x0 is not a valid pointer
70+
| inside `std::ptr::const_ptr::<impl *const u8>::offset_from` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
71+
| inside `OFFSET_FROM_NULL` at $DIR/offset_from_ub.rs:37:14
7272
|
7373
::: $DIR/offset_from_ub.rs:34:1
7474
|
@@ -82,12 +82,12 @@ LL | | };
8282
error: any use of this value will cause an error
8383
--> $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
8484
|
85-
LL | intrinsics::ptr_offset_from(self, origin)
86-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
87-
| |
88-
| unable to turn bytes into a pointer
89-
| inside `std::ptr::const_ptr::<impl *const u8>::offset_from` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
90-
| inside `DIFFERENT_INT` at $DIR/offset_from_ub.rs:44:14
85+
LL | unsafe { intrinsics::ptr_offset_from(self, origin) }
86+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
87+
| |
88+
| unable to turn bytes into a pointer
89+
| inside `std::ptr::const_ptr::<impl *const u8>::offset_from` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
90+
| inside `DIFFERENT_INT` at $DIR/offset_from_ub.rs:44:14
9191
|
9292
::: $DIR/offset_from_ub.rs:40:1
9393
|

src/test/ui/consts/offset_ub.stderr

+66-66
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
error: any use of this value will cause an error
22
--> $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
33
|
4-
LL | intrinsics::offset(self, count)
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6-
| |
7-
| overflowing in-bounds pointer arithmetic
8-
| inside `std::ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
9-
| inside `BEFORE_START` at $DIR/offset_ub.rs:7:46
4+
LL | unsafe { intrinsics::offset(self, count) }
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6+
| |
7+
| overflowing in-bounds pointer arithmetic
8+
| inside `std::ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
9+
| inside `BEFORE_START` at $DIR/offset_ub.rs:7:46
1010
|
1111
::: $DIR/offset_ub.rs:7:1
1212
|
@@ -18,12 +18,12 @@ LL | pub const BEFORE_START: *const u8 = unsafe { (&0u8 as *const u8).offset(-1)
1818
error: any use of this value will cause an error
1919
--> $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
2020
|
21-
LL | intrinsics::offset(self, count)
22-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
23-
| |
24-
| inbounds test failed: pointer must be in-bounds at offset 2, but is outside bounds of allocN which has size 1
25-
| inside `std::ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
26-
| inside `AFTER_END` at $DIR/offset_ub.rs:8:43
21+
LL | unsafe { intrinsics::offset(self, count) }
22+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
23+
| |
24+
| inbounds test failed: pointer must be in-bounds at offset 2, but is outside bounds of allocN which has size 1
25+
| inside `std::ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
26+
| inside `AFTER_END` at $DIR/offset_ub.rs:8:43
2727
|
2828
::: $DIR/offset_ub.rs:8:1
2929
|
@@ -33,12 +33,12 @@ LL | pub const AFTER_END: *const u8 = unsafe { (&0u8 as *const u8).offset(2) };
3333
error: any use of this value will cause an error
3434
--> $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
3535
|
36-
LL | intrinsics::offset(self, count)
37-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
38-
| |
39-
| inbounds test failed: pointer must be in-bounds at offset 101, but is outside bounds of allocN which has size 100
40-
| inside `std::ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
41-
| inside `AFTER_ARRAY` at $DIR/offset_ub.rs:9:45
36+
LL | unsafe { intrinsics::offset(self, count) }
37+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
38+
| |
39+
| inbounds test failed: pointer must be in-bounds at offset 101, but is outside bounds of allocN which has size 100
40+
| inside `std::ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
41+
| inside `AFTER_ARRAY` at $DIR/offset_ub.rs:9:45
4242
|
4343
::: $DIR/offset_ub.rs:9:1
4444
|
@@ -48,12 +48,12 @@ LL | pub const AFTER_ARRAY: *const u8 = unsafe { [0u8; 100].as_ptr().offset(101)
4848
error: any use of this value will cause an error
4949
--> $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
5050
|
51-
LL | intrinsics::offset(self, count)
52-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
53-
| |
54-
| overflowing in-bounds pointer arithmetic
55-
| inside `std::ptr::const_ptr::<impl *const u16>::offset` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
56-
| inside `OVERFLOW` at $DIR/offset_ub.rs:11:43
51+
LL | unsafe { intrinsics::offset(self, count) }
52+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
53+
| |
54+
| overflowing in-bounds pointer arithmetic
55+
| inside `std::ptr::const_ptr::<impl *const u16>::offset` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
56+
| inside `OVERFLOW` at $DIR/offset_ub.rs:11:43
5757
|
5858
::: $DIR/offset_ub.rs:11:1
5959
|
@@ -63,12 +63,12 @@ LL | pub const OVERFLOW: *const u16 = unsafe { [0u16; 1].as_ptr().offset(isize::
6363
error: any use of this value will cause an error
6464
--> $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
6565
|
66-
LL | intrinsics::offset(self, count)
67-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
68-
| |
69-
| overflowing in-bounds pointer arithmetic
70-
| inside `std::ptr::const_ptr::<impl *const u16>::offset` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
71-
| inside `UNDERFLOW` at $DIR/offset_ub.rs:12:44
66+
LL | unsafe { intrinsics::offset(self, count) }
67+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
68+
| |
69+
| overflowing in-bounds pointer arithmetic
70+
| inside `std::ptr::const_ptr::<impl *const u16>::offset` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
71+
| inside `UNDERFLOW` at $DIR/offset_ub.rs:12:44
7272
|
7373
::: $DIR/offset_ub.rs:12:1
7474
|
@@ -78,12 +78,12 @@ LL | pub const UNDERFLOW: *const u16 = unsafe { [0u16; 1].as_ptr().offset(isize:
7878
error: any use of this value will cause an error
7979
--> $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
8080
|
81-
LL | intrinsics::offset(self, count)
82-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
83-
| |
84-
| overflowing in-bounds pointer arithmetic
85-
| inside `std::ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
86-
| inside `OVERFLOW_ADDRESS_SPACE` at $DIR/offset_ub.rs:13:56
81+
LL | unsafe { intrinsics::offset(self, count) }
82+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
83+
| |
84+
| overflowing in-bounds pointer arithmetic
85+
| inside `std::ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
86+
| inside `OVERFLOW_ADDRESS_SPACE` at $DIR/offset_ub.rs:13:56
8787
|
8888
::: $DIR/offset_ub.rs:13:1
8989
|
@@ -93,12 +93,12 @@ LL | pub const OVERFLOW_ADDRESS_SPACE: *const u8 = unsafe { (usize::MAX as *cons
9393
error: any use of this value will cause an error
9494
--> $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
9595
|
96-
LL | intrinsics::offset(self, count)
97-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
98-
| |
99-
| overflowing in-bounds pointer arithmetic
100-
| inside `std::ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
101-
| inside `UNDERFLOW_ADDRESS_SPACE` at $DIR/offset_ub.rs:14:57
96+
LL | unsafe { intrinsics::offset(self, count) }
97+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
98+
| |
99+
| overflowing in-bounds pointer arithmetic
100+
| inside `std::ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
101+
| inside `UNDERFLOW_ADDRESS_SPACE` at $DIR/offset_ub.rs:14:57
102102
|
103103
::: $DIR/offset_ub.rs:14:1
104104
|
@@ -108,12 +108,12 @@ LL | pub const UNDERFLOW_ADDRESS_SPACE: *const u8 = unsafe { (1 as *const u8).of
108108
error: any use of this value will cause an error
109109
--> $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
110110
|
111-
LL | intrinsics::offset(self, count)
112-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
113-
| |
114-
| inbounds test failed: pointer must be in-bounds at offset 1, but is outside bounds of allocN which has size 0
115-
| inside `std::ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
116-
| inside `ZERO_SIZED_ALLOC` at $DIR/offset_ub.rs:16:50
111+
LL | unsafe { intrinsics::offset(self, count) }
112+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
113+
| |
114+
| inbounds test failed: pointer must be in-bounds at offset 1, but is outside bounds of allocN which has size 0
115+
| inside `std::ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
116+
| inside `ZERO_SIZED_ALLOC` at $DIR/offset_ub.rs:16:50
117117
|
118118
::: $DIR/offset_ub.rs:16:1
119119
|
@@ -123,12 +123,12 @@ LL | pub const ZERO_SIZED_ALLOC: *const u8 = unsafe { [0u8; 0].as_ptr().offset(1
123123
error: any use of this value will cause an error
124124
--> $SRC_DIR/libcore/ptr/mut_ptr.rs:LL:COL
125125
|
126-
LL | intrinsics::offset(self, count) as *mut T
127-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
128-
| |
129-
| unable to turn bytes into a pointer
130-
| inside `std::ptr::mut_ptr::<impl *mut u8>::offset` at $SRC_DIR/libcore/ptr/mut_ptr.rs:LL:COL
131-
| inside `DANGLING` at $DIR/offset_ub.rs:17:42
126+
LL | unsafe { intrinsics::offset(self, count) as *mut T }
127+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
128+
| |
129+
| unable to turn bytes into a pointer
130+
| inside `std::ptr::mut_ptr::<impl *mut u8>::offset` at $SRC_DIR/libcore/ptr/mut_ptr.rs:LL:COL
131+
| inside `DANGLING` at $DIR/offset_ub.rs:17:42
132132
|
133133
::: $DIR/offset_ub.rs:17:1
134134
|
@@ -138,12 +138,12 @@ LL | pub const DANGLING: *const u8 = unsafe { ptr::NonNull::<u8>::dangling().as_
138138
error: any use of this value will cause an error
139139
--> $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
140140
|
141-
LL | intrinsics::offset(self, count)
142-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
143-
| |
144-
| inbounds test failed: 0x0 is not a valid pointer
145-
| inside `std::ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
146-
| inside `NULL_OFFSET_ZERO` at $DIR/offset_ub.rs:20:50
141+
LL | unsafe { intrinsics::offset(self, count) }
142+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
143+
| |
144+
| inbounds test failed: 0x0 is not a valid pointer
145+
| inside `std::ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
146+
| inside `NULL_OFFSET_ZERO` at $DIR/offset_ub.rs:20:50
147147
|
148148
::: $DIR/offset_ub.rs:20:1
149149
|
@@ -153,12 +153,12 @@ LL | pub const NULL_OFFSET_ZERO: *const u8 = unsafe { ptr::null::<u8>().offset(0
153153
error: any use of this value will cause an error
154154
--> $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
155155
|
156-
LL | intrinsics::offset(self, count)
157-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
158-
| |
159-
| unable to turn bytes into a pointer
160-
| inside `std::ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
161-
| inside `UNDERFLOW_ABS` at $DIR/offset_ub.rs:23:47
156+
LL | unsafe { intrinsics::offset(self, count) }
157+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
158+
| |
159+
| unable to turn bytes into a pointer
160+
| inside `std::ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/libcore/ptr/const_ptr.rs:LL:COL
161+
| inside `UNDERFLOW_ABS` at $DIR/offset_ub.rs:23:47
162162
|
163163
::: $DIR/offset_ub.rs:23:1
164164
|

src/test/ui/recursion/issue-38591-non-regular-dropck-recursion.stderr

+6-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ error: reached the recursion limit while instantiating `std::intrinsics::drop_in
44
LL | / pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {
55
LL | | // Code here does not matter - this is replaced by the
66
LL | | // real drop glue by the compiler.
7-
LL | | drop_in_place(to_drop)
7+
LL | |
8+
LL | | // SAFETY: see comment above
9+
LL | | unsafe { drop_in_place(to_drop) }
810
LL | | }
911
| |_^
1012
|
@@ -14,7 +16,9 @@ note: `std::intrinsics::drop_in_place` defined here
1416
LL | / pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {
1517
LL | | // Code here does not matter - this is replaced by the
1618
LL | | // real drop glue by the compiler.
17-
LL | | drop_in_place(to_drop)
19+
LL | |
20+
LL | | // SAFETY: see comment above
21+
LL | | unsafe { drop_in_place(to_drop) }
1822
LL | | }
1923
| |_^
2024

0 commit comments

Comments
 (0)