Skip to content

Commit 091433d

Browse files
committed
Rename stderr->64bit.stderr where needed.
1 parent c3ec0ad commit 091433d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+192
-157
lines changed

src/test/ui/const-generics/min_const_generics/invalid-patterns.stderr renamed to src/test/ui/const-generics/min_const_generics/invalid-patterns.64bit.stderr

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
error[E0308]: mismatched types
2-
--> $DIR/invalid-patterns.rs:28:21
2+
--> $DIR/invalid-patterns.rs:29:21
33
|
44
LL | get_flag::<false, 0xFF>();
55
| ^^^^ expected `char`, found `u8`
66

77
error[E0308]: mismatched types
8-
--> $DIR/invalid-patterns.rs:30:14
8+
--> $DIR/invalid-patterns.rs:31:14
99
|
1010
LL | get_flag::<7, 'c'>();
1111
| ^ expected `bool`, found integer
1212

1313
error[E0308]: mismatched types
14-
--> $DIR/invalid-patterns.rs:32:14
14+
--> $DIR/invalid-patterns.rs:33:14
1515
|
1616
LL | get_flag::<42, 0x5ad>();
1717
| ^^ expected `bool`, found integer
1818

1919
error[E0308]: mismatched types
20-
--> $DIR/invalid-patterns.rs:32:18
20+
--> $DIR/invalid-patterns.rs:33:18
2121
|
2222
LL | get_flag::<42, 0x5ad>();
2323
| ^^^^^ expected `char`, found `u8`
2424

2525
error[E0080]: it is undefined behavior to use this value
26-
--> $DIR/invalid-patterns.rs:37:21
26+
--> $DIR/invalid-patterns.rs:38:21
2727
|
2828
LL | get_flag::<false, { unsafe { char_raw.character } }>();
2929
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered uninitialized bytes, but expected a valid unicode scalar value (in `0..=0x10FFFF` but not in `0xD800..=0xDFFF`)
@@ -34,7 +34,7 @@ LL | get_flag::<false, { unsafe { char_raw.character } }>();
3434
}
3535

3636
error[E0080]: it is undefined behavior to use this value
37-
--> $DIR/invalid-patterns.rs:39:14
37+
--> $DIR/invalid-patterns.rs:40:14
3838
|
3939
LL | get_flag::<{ unsafe { bool_raw.boolean } }, 'z'>();
4040
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 0x42, but expected a boolean
@@ -45,7 +45,7 @@ LL | get_flag::<{ unsafe { bool_raw.boolean } }, 'z'>();
4545
}
4646

4747
error[E0080]: it is undefined behavior to use this value
48-
--> $DIR/invalid-patterns.rs:41:14
48+
--> $DIR/invalid-patterns.rs:42:14
4949
|
5050
LL | get_flag::<{ unsafe { bool_raw.boolean } }, { unsafe { char_raw.character } }>();
5151
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 0x42, but expected a boolean
@@ -56,7 +56,7 @@ LL | get_flag::<{ unsafe { bool_raw.boolean } }, { unsafe { char_raw.character
5656
}
5757

5858
error[E0080]: it is undefined behavior to use this value
59-
--> $DIR/invalid-patterns.rs:41:47
59+
--> $DIR/invalid-patterns.rs:42:47
6060
|
6161
LL | get_flag::<{ unsafe { bool_raw.boolean } }, { unsafe { char_raw.character } }>();
6262
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered uninitialized bytes, but expected a valid unicode scalar value (in `0..=0x10FFFF` but not in `0xD800..=0xDFFF`)

src/test/ui/const-generics/min_const_generics/invalid-patterns.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// stderr-per-bitwidth
12
use std::mem::transmute;
23

34
fn get_flag<const FlagSet: bool, const ShortName: char>() -> Option<char> {

src/test/ui/consts/const-err4.stderr renamed to src/test/ui/consts/const-err4.64bit.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0080]: it is undefined behavior to use this value
2-
--> $DIR/const-err4.rs:8:11
2+
--> $DIR/const-err4.rs:9:11
33
|
44
LL | Boo = [unsafe { Foo { b: () }.a }; 4][3],
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered uninitialized bytes, but expected initialized plain (non-pointer) bytes

src/test/ui/consts/const-err4.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// stderr-per-bitwidth
12
#[derive(Copy, Clone)]
23
union Foo {
34
a: isize,

src/test/ui/consts/const-eval/const-pointer-values-in-various-types.stderr renamed to src/test/ui/consts/const-eval/const-pointer-values-in-various-types.64bit.stderr

+29-29
Large diffs are not rendered by default.

src/test/ui/consts/const-eval/const-pointer-values-in-various-types.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// only-x86_64
2+
// stderr-per-bitwidth
23

34
#[repr(C)]
45
union Nonsense {

src/test/ui/consts/const-eval/heap/alloc_intrinsic_uninit.stderr renamed to src/test/ui/consts/const-eval/heap/alloc_intrinsic_uninit.64bit.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0080]: it is undefined behavior to use this value
2-
--> $DIR/alloc_intrinsic_uninit.rs:8:1
2+
--> $DIR/alloc_intrinsic_uninit.rs:9:1
33
|
44
LL | const BAR: &i32 = unsafe { &*(intrinsics::const_allocate(4, 4) as *mut i32) };
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered uninitialized bytes at .<deref>, but expected initialized plain (non-pointer) bytes

src/test/ui/consts/const-eval/heap/alloc_intrinsic_uninit.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// stderr-per-bitwidth
12
// compile-test
23
#![feature(core_intrinsics)]
34
#![feature(const_heap)]

src/test/ui/consts/const-eval/ref_to_int_match.stderr renamed to src/test/ui/consts/const-eval/ref_to_int_match.64bit.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0080]: it is undefined behavior to use this value
2-
--> $DIR/ref_to_int_match.rs:25:1
2+
--> $DIR/ref_to_int_match.rs:26:1
33
|
44
LL | const BAR: Int = unsafe { Foo { r: &42 }.f };
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered pointer to alloc2, but expected initialized plain (non-pointer) bytes
@@ -10,13 +10,13 @@ LL | const BAR: Int = unsafe { Foo { r: &42 }.f };
1010
}
1111

1212
error: could not evaluate constant pattern
13-
--> $DIR/ref_to_int_match.rs:7:14
13+
--> $DIR/ref_to_int_match.rs:8:14
1414
|
1515
LL | 10..=BAR => {},
1616
| ^^^
1717

1818
error: could not evaluate constant pattern
19-
--> $DIR/ref_to_int_match.rs:7:14
19+
--> $DIR/ref_to_int_match.rs:8:14
2020
|
2121
LL | 10..=BAR => {},
2222
| ^^^

src/test/ui/consts/const-eval/ref_to_int_match.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// stderr-per-bitwidth
12
#![feature(const_fn_union)]
23

34
fn main() {

src/test/ui/consts/const-eval/transmute-const.stderr renamed to src/test/ui/consts/const-eval/transmute-const.64bit.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0080]: it is undefined behavior to use this value
2-
--> $DIR/transmute-const.rs:3:1
2+
--> $DIR/transmute-const.rs:4:1
33
|
44
LL | static FOO: bool = unsafe { mem::transmute(3u8) };
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 0x03, but expected a boolean

src/test/ui/consts/const-eval/transmute-const.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// stderr-per-bitwidth
12
use std::mem;
23

34
static FOO: bool = unsafe { mem::transmute(3u8) };

src/test/ui/consts/const-eval/ub-enum.stderr renamed to src/test/ui/consts/const-eval/ub-enum.64bit.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0080]: it is undefined behavior to use this value
22
--> $DIR/ub-enum.rs:24:1
33
|
44
LL | const BAD_ENUM: Enum = unsafe { mem::transmute(1usize) };
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 0x00000001 at .<enum-tag>, but expected a valid enum tag
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 0x0000000000000001 at .<enum-tag>, but expected a valid enum tag
66
|
77
= 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.
88
= note: the raw bytes of the constant (size: 8, align: 8) {
@@ -35,7 +35,7 @@ error[E0080]: it is undefined behavior to use this value
3535
--> $DIR/ub-enum.rs:42:1
3636
|
3737
LL | const BAD_ENUM2: Enum2 = unsafe { mem::transmute(0usize) };
38-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 0x00000000 at .<enum-tag>, but expected a valid enum tag
38+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 0x0000000000000000 at .<enum-tag>, but expected a valid enum tag
3939
|
4040
= 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.
4141
= note: the raw bytes of the constant (size: 8, align: 8) {

src/test/ui/consts/const-eval/ub-enum.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// normalize-stderr-64bit "0x0000000000" -> "0x00"
1+
// stderr-per-bitwidth
22
#![feature(never_type)]
33
#![allow(const_err)] // make sure we cannot allow away the errors tested here
44

src/test/ui/consts/const-eval/ub-int-array.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![allow(const_err)] // make sure we cannot allow away the errors tested here
2-
2+
// stderr-per-bitwidth
33
//! Test the "array of int" fast path in validity checking, and in particular whether it
44
//! points at the right array element.
55

src/test/ui/consts/const-eval/ub-nonnull.stderr renamed to src/test/ui/consts/const-eval/ub-nonnull.64bit.stderr

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0080]: it is undefined behavior to use this value
2-
--> $DIR/ub-nonnull.rs:11:1
2+
--> $DIR/ub-nonnull.rs:12:1
33
|
44
LL | const NULL_PTR: NonNull<u8> = unsafe { mem::transmute(0usize) };
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 0, but expected something greater or equal to 1
@@ -10,7 +10,7 @@ LL | const NULL_PTR: NonNull<u8> = unsafe { mem::transmute(0usize) };
1010
}
1111

1212
error: any use of this value will cause an error
13-
--> $DIR/ub-nonnull.rs:18:30
13+
--> $DIR/ub-nonnull.rs:19:30
1414
|
1515
LL | / const OUT_OF_BOUNDS_PTR: NonNull<u8> = { unsafe {
1616
LL | | let ptr: &[u8; 256] = mem::transmute(&0u8); // &0 gets promoted so it does not dangle
@@ -23,15 +23,15 @@ LL | | } };
2323
| |____-
2424
|
2525
note: the lint level is defined here
26-
--> $DIR/ub-nonnull.rs:14:8
26+
--> $DIR/ub-nonnull.rs:15:8
2727
|
2828
LL | #[deny(const_err)] // this triggers a `const_err` so validation does not even happen
2929
| ^^^^^^^^^
3030
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
3131
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
3232

3333
error[E0080]: it is undefined behavior to use this value
34-
--> $DIR/ub-nonnull.rs:23:1
34+
--> $DIR/ub-nonnull.rs:24:1
3535
|
3636
LL | const NULL_U8: NonZeroU8 = unsafe { mem::transmute(0u8) };
3737
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 0, but expected something greater or equal to 1
@@ -42,7 +42,7 @@ LL | const NULL_U8: NonZeroU8 = unsafe { mem::transmute(0u8) };
4242
}
4343

4444
error[E0080]: it is undefined behavior to use this value
45-
--> $DIR/ub-nonnull.rs:25:1
45+
--> $DIR/ub-nonnull.rs:26:1
4646
|
4747
LL | const NULL_USIZE: NonZeroUsize = unsafe { mem::transmute(0usize) };
4848
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 0, but expected something greater or equal to 1
@@ -53,7 +53,7 @@ LL | const NULL_USIZE: NonZeroUsize = unsafe { mem::transmute(0usize) };
5353
}
5454

5555
error[E0080]: it is undefined behavior to use this value
56-
--> $DIR/ub-nonnull.rs:33:1
56+
--> $DIR/ub-nonnull.rs:34:1
5757
|
5858
LL | const UNINIT: NonZeroU8 = unsafe { MaybeUninit { uninit: () }.init };
5959
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered uninitialized bytes at .0, but expected initialized plain (non-pointer) bytes
@@ -64,7 +64,7 @@ LL | const UNINIT: NonZeroU8 = unsafe { MaybeUninit { uninit: () }.init };
6464
}
6565

6666
error[E0080]: it is undefined behavior to use this value
67-
--> $DIR/ub-nonnull.rs:41:1
67+
--> $DIR/ub-nonnull.rs:42:1
6868
|
6969
LL | const BAD_RANGE1: RestrictedRange1 = unsafe { RestrictedRange1(42) };
7070
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 42, but expected something in the range 10..=30
@@ -75,7 +75,7 @@ LL | const BAD_RANGE1: RestrictedRange1 = unsafe { RestrictedRange1(42) };
7575
}
7676

7777
error[E0080]: it is undefined behavior to use this value
78-
--> $DIR/ub-nonnull.rs:47:1
78+
--> $DIR/ub-nonnull.rs:48:1
7979
|
8080
LL | const BAD_RANGE2: RestrictedRange2 = unsafe { RestrictedRange2(20) };
8181
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 20, but expected something less or equal to 10, or greater or equal to 30

src/test/ui/consts/const-eval/ub-nonnull.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// stderr-per-bitwidth
12
#![feature(rustc_attrs)]
23
#![allow(const_err, invalid_value)] // make sure we cannot allow away the errors tested here
34

src/test/ui/consts/const-eval/ub-ref-ptr.stderr renamed to src/test/ui/consts/const-eval/ub-ref-ptr.64bit.stderr

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0080]: it is undefined behavior to use this value
2-
--> $DIR/ub-ref-ptr.rs:12:1
2+
--> $DIR/ub-ref-ptr.rs:13:1
33
|
44
LL | const UNALIGNED: &u16 = unsafe { mem::transmute(&[0u8; 4]) };
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered an unaligned reference (required 2 byte alignment but found 1)
@@ -10,7 +10,7 @@ LL | const UNALIGNED: &u16 = unsafe { mem::transmute(&[0u8; 4]) };
1010
}
1111

1212
error[E0080]: it is undefined behavior to use this value
13-
--> $DIR/ub-ref-ptr.rs:16:1
13+
--> $DIR/ub-ref-ptr.rs:17:1
1414
|
1515
LL | const UNALIGNED_BOX: Box<u16> = unsafe { mem::transmute(&[0u8; 4]) };
1616
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered an unaligned box (required 2 byte alignment but found 1)
@@ -21,7 +21,7 @@ LL | const UNALIGNED_BOX: Box<u16> = unsafe { mem::transmute(&[0u8; 4]) };
2121
}
2222

2323
error[E0080]: it is undefined behavior to use this value
24-
--> $DIR/ub-ref-ptr.rs:20:1
24+
--> $DIR/ub-ref-ptr.rs:21:1
2525
|
2626
LL | const NULL: &u16 = unsafe { mem::transmute(0usize) };
2727
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a NULL reference
@@ -32,7 +32,7 @@ LL | const NULL: &u16 = unsafe { mem::transmute(0usize) };
3232
}
3333

3434
error[E0080]: it is undefined behavior to use this value
35-
--> $DIR/ub-ref-ptr.rs:23:1
35+
--> $DIR/ub-ref-ptr.rs:24:1
3636
|
3737
LL | const NULL_BOX: Box<u16> = unsafe { mem::transmute(0usize) };
3838
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a NULL box
@@ -43,7 +43,7 @@ LL | const NULL_BOX: Box<u16> = unsafe { mem::transmute(0usize) };
4343
}
4444

4545
error[E0080]: it is undefined behavior to use this value
46-
--> $DIR/ub-ref-ptr.rs:29:1
46+
--> $DIR/ub-ref-ptr.rs:30:1
4747
|
4848
LL | const REF_AS_USIZE: usize = unsafe { mem::transmute(&0) };
4949
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered pointer to alloc14, but expected initialized plain (non-pointer) bytes
@@ -54,7 +54,7 @@ LL | const REF_AS_USIZE: usize = unsafe { mem::transmute(&0) };
5454
}
5555

5656
error[E0080]: it is undefined behavior to use this value
57-
--> $DIR/ub-ref-ptr.rs:32:1
57+
--> $DIR/ub-ref-ptr.rs:33:1
5858
|
5959
LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }];
6060
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a pointer at .<deref>, but expected plain (non-pointer) bytes
@@ -65,7 +65,7 @@ LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }];
6565
}
6666

6767
error[E0080]: it is undefined behavior to use this value
68-
--> $DIR/ub-ref-ptr.rs:35:1
68+
--> $DIR/ub-ref-ptr.rs:36:1
6969
|
7070
LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[usize], _>(&[mem::transmute(&0)]) };
7171
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a pointer at .<deref>, but expected plain (non-pointer) bytes
@@ -76,7 +76,7 @@ LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[us
7676
}
7777

7878
error[E0080]: it is undefined behavior to use this value
79-
--> $DIR/ub-ref-ptr.rs:38:1
79+
--> $DIR/ub-ref-ptr.rs:39:1
8080
|
8181
LL | const USIZE_AS_REF: &'static u8 = unsafe { mem::transmute(1337usize) };
8282
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a dangling reference (created from integer)
@@ -87,7 +87,7 @@ LL | const USIZE_AS_REF: &'static u8 = unsafe { mem::transmute(1337usize) };
8787
}
8888

8989
error[E0080]: it is undefined behavior to use this value
90-
--> $DIR/ub-ref-ptr.rs:41:1
90+
--> $DIR/ub-ref-ptr.rs:42:1
9191
|
9292
LL | const USIZE_AS_BOX: Box<u8> = unsafe { mem::transmute(1337usize) };
9393
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a dangling box (created from integer)
@@ -98,7 +98,7 @@ LL | const USIZE_AS_BOX: Box<u8> = unsafe { mem::transmute(1337usize) };
9898
}
9999

100100
error[E0080]: it is undefined behavior to use this value
101-
--> $DIR/ub-ref-ptr.rs:44:1
101+
--> $DIR/ub-ref-ptr.rs:45:1
102102
|
103103
LL | const UNINIT_PTR: *const i32 = unsafe { MaybeUninit { uninit: () }.init };
104104
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered uninitialized raw pointer
@@ -109,7 +109,7 @@ LL | const UNINIT_PTR: *const i32 = unsafe { MaybeUninit { uninit: () }.init };
109109
}
110110

111111
error[E0080]: it is undefined behavior to use this value
112-
--> $DIR/ub-ref-ptr.rs:46:1
112+
--> $DIR/ub-ref-ptr.rs:47:1
113113
|
114114
LL | const UNINIT_FN_PTR: fn() = unsafe { MaybeUninit { uninit: () }.init };
115115
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered uninitialized bytes, but expected a function pointer

src/test/ui/consts/const-eval/ub-ref-ptr.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// ignore-tidy-linelength
2+
// stderr-per-bitwidth
23
#![allow(const_err, invalid_value)] // make sure we cannot allow away the errors tested here
34

45
use std::mem;

src/test/ui/consts/const-eval/ub-uninhabit.stderr renamed to src/test/ui/consts/const-eval/ub-uninhabit.64bit.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0080]: it is undefined behavior to use this value
2-
--> $DIR/ub-uninhabit.rs:14:1
2+
--> $DIR/ub-uninhabit.rs:15:1
33
|
44
LL | const BAD_BAD_BAD: Bar = unsafe { MaybeUninit { uninit: () }.init };
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a value of uninhabited type Bar
@@ -8,7 +8,7 @@ LL | const BAD_BAD_BAD: Bar = unsafe { MaybeUninit { uninit: () }.init };
88
= note: the raw bytes of the constant (size: 0, align: 1) {}
99

1010
error[E0080]: it is undefined behavior to use this value
11-
--> $DIR/ub-uninhabit.rs:17:1
11+
--> $DIR/ub-uninhabit.rs:18:1
1212
|
1313
LL | const BAD_BAD_REF: &Bar = unsafe { mem::transmute(1usize) };
1414
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a value of uninhabited type Bar at .<deref>
@@ -19,7 +19,7 @@ LL | const BAD_BAD_REF: &Bar = unsafe { mem::transmute(1usize) };
1919
}
2020

2121
error[E0080]: it is undefined behavior to use this value
22-
--> $DIR/ub-uninhabit.rs:20:1
22+
--> $DIR/ub-uninhabit.rs:21:1
2323
|
2424
LL | const BAD_BAD_ARRAY: [Bar; 1] = unsafe { MaybeUninit { uninit: () }.init };
2525
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a value of uninhabited type Bar at [0]

src/test/ui/consts/const-eval/ub-uninhabit.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// stderr-per-bitwidth
12
#![allow(const_err)] // make sure we cannot allow away the errors tested here
23

34
use std::mem;

src/test/ui/consts/const-eval/ub-upvars.stderr renamed to src/test/ui/consts/const-eval/ub-upvars.64bit.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0080]: it is undefined behavior to use this value
2-
--> $DIR/ub-upvars.rs:5:1
2+
--> $DIR/ub-upvars.rs:6:1
33
|
44
LL | / const BAD_UPVAR: &dyn FnOnce() = &{
55
LL | | let bad_ref: &'static u16 = unsafe { mem::transmute(0usize) };

src/test/ui/consts/const-eval/ub-upvars.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// stderr-per-bitwidth
12
#![allow(const_err, invalid_value)] // make sure we cannot allow away the errors tested here
23

34
use std::mem;

0 commit comments

Comments
 (0)