Skip to content

Commit f68e79d

Browse files
committed
remove stderr-per-bitwidth from some tests
1 parent 0702701 commit f68e79d

15 files changed

+53
-311
lines changed

tests/ui/consts/const-eval/validate_uninhabited_zsts.64bit.stderr

Lines changed: 0 additions & 52 deletions
This file was deleted.

tests/ui/consts/const-eval/validate_uninhabited_zsts.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// stderr-per-bitwidth
2-
31
const fn foo() -> ! {
42
unsafe { std::mem::transmute(()) }
53
//~^ ERROR evaluation of constant value failed

tests/ui/consts/const-eval/validate_uninhabited_zsts.32bit.stderr renamed to tests/ui/consts/const-eval/validate_uninhabited_zsts.stderr

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
warning: the type `!` does not permit zero-initialization
2-
--> $DIR/validate_uninhabited_zsts.rs:4:14
2+
--> $DIR/validate_uninhabited_zsts.rs:2:14
33
|
44
LL | unsafe { std::mem::transmute(()) }
55
| ^^^^^^^^^^^^^^^^^^^^^^^ this code causes undefined behavior when executed
@@ -8,41 +8,41 @@ LL | unsafe { std::mem::transmute(()) }
88
= note: `#[warn(invalid_value)]` on by default
99

1010
error[E0080]: evaluation of constant value failed
11-
--> $DIR/validate_uninhabited_zsts.rs:4:14
11+
--> $DIR/validate_uninhabited_zsts.rs:2:14
1212
|
1313
LL | unsafe { std::mem::transmute(()) }
1414
| ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a value of the never type `!`
1515
|
1616
note: inside `foo`
17-
--> $DIR/validate_uninhabited_zsts.rs:4:14
17+
--> $DIR/validate_uninhabited_zsts.rs:2:14
1818
|
1919
LL | unsafe { std::mem::transmute(()) }
2020
| ^^^^^^^^^^^^^^^^^^^^^^^
2121
note: inside `FOO`
22-
--> $DIR/validate_uninhabited_zsts.rs:19:33
22+
--> $DIR/validate_uninhabited_zsts.rs:17:33
2323
|
2424
LL | const FOO: [empty::Empty; 3] = [foo(); 3];
2525
| ^^^^^
2626

2727
error[E0080]: evaluation of constant value failed
28-
--> $DIR/validate_uninhabited_zsts.rs:21:42
28+
--> $DIR/validate_uninhabited_zsts.rs:19:42
2929
|
3030
LL | const BAR: [empty::Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
3131
| ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered a value of uninhabited type `Void`
3232

3333
warning: the type `empty::Empty` does not permit zero-initialization
34-
--> $DIR/validate_uninhabited_zsts.rs:21:42
34+
--> $DIR/validate_uninhabited_zsts.rs:19:42
3535
|
3636
LL | const BAR: [empty::Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
3737
| ^^^^^^^^^^^^^^^^^^^^^^^ this code causes undefined behavior when executed
3838
|
3939
note: in this struct field
40-
--> $DIR/validate_uninhabited_zsts.rs:16:22
40+
--> $DIR/validate_uninhabited_zsts.rs:14:22
4141
|
4242
LL | pub struct Empty(Void);
4343
| ^^^^
4444
note: enums with no inhabited variants have no valid value
45-
--> $DIR/validate_uninhabited_zsts.rs:13:5
45+
--> $DIR/validate_uninhabited_zsts.rs:11:5
4646
|
4747
LL | enum Void {}
4848
| ^^^^^^^^^

tests/ui/consts/const-mut-refs/issue-76510.64bit.stderr

Lines changed: 0 additions & 26 deletions
This file was deleted.

tests/ui/consts/const-mut-refs/issue-76510.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// stderr-per-bitwidth
2-
31
use std::mem::{transmute, ManuallyDrop};
42

53
const S: &'static mut str = &mut " hello ";

tests/ui/consts/const-mut-refs/issue-76510.32bit.stderr renamed to tests/ui/consts/const-mut-refs/issue-76510.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error[E0764]: mutable references are not allowed in the final value of constants
2-
--> $DIR/issue-76510.rs:5:29
2+
--> $DIR/issue-76510.rs:3:29
33
|
44
LL | const S: &'static mut str = &mut " hello ";
55
| ^^^^^^^^^^^^^^
66

77
error[E0658]: mutation through a reference is not allowed in constants
8-
--> $DIR/issue-76510.rs:5:29
8+
--> $DIR/issue-76510.rs:3:29
99
|
1010
LL | const S: &'static mut str = &mut " hello ";
1111
| ^^^^^^^^^^^^^^
@@ -15,7 +15,7 @@ LL | const S: &'static mut str = &mut " hello ";
1515
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
1616

1717
error[E0596]: cannot borrow data in a `&` reference as mutable
18-
--> $DIR/issue-76510.rs:5:29
18+
--> $DIR/issue-76510.rs:3:29
1919
|
2020
LL | const S: &'static mut str = &mut " hello ";
2121
| ^^^^^^^^^^^^^^ cannot borrow as mutable

tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.64bit.stderr

Lines changed: 0 additions & 25 deletions
This file was deleted.

tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
// stderr-per-bitwidth
1+
// normalize-stderr-test "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
2+
// normalize-stderr-test "([0-9a-f][0-9a-f] |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"
23
#![feature(const_mut_refs, const_refs_to_static)]
34
#![feature(raw_ref_op)]
45

tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.32bit.stderr renamed to tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.stderr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
error[E0080]: it is undefined behavior to use this value
2-
--> $DIR/mut_ref_in_final_dynamic_check.rs:16:1
2+
--> $DIR/mut_ref_in_final_dynamic_check.rs:17:1
33
|
44
LL | const A: Option<&mut i32> = helper();
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(Some)>.0: encountered mutable reference in a `const` or `static`
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.
8-
= note: the raw bytes of the constant (size: 4, align: 4) {
9-
╾ALLOC0╼ │ ╾──╼
8+
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
9+
HEX_DUMP
1010
}
1111

1212
error[E0080]: it is undefined behavior to use this value
13-
--> $DIR/mut_ref_in_final_dynamic_check.rs:18:1
13+
--> $DIR/mut_ref_in_final_dynamic_check.rs:19:1
1414
|
1515
LL | static A_STATIC: Option<&mut i32> = helper();
1616
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(Some)>.0: encountered mutable reference in a `const` or `static`
1717
|
1818
= 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: 4, align: 4) {
20-
╾ALLOC0╼ │ ╾──╼
19+
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
20+
HEX_DUMP
2121
}
2222

2323
error: aborting due to 2 previous errors

tests/ui/consts/miri_unleashed/const_refers_to_static.64bit.stderr

Lines changed: 0 additions & 65 deletions
This file was deleted.

tests/ui/consts/miri_unleashed/const_refers_to_static.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// compile-flags: -Zunleash-the-miri-inside-of-you
2-
// stderr-per-bitwidth
2+
// normalize-stderr-test "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
3+
// normalize-stderr-test "([0-9a-f][0-9a-f] |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"
34

45
use std::sync::atomic::AtomicUsize;
56
use std::sync::atomic::Ordering;

tests/ui/consts/miri_unleashed/const_refers_to_static.32bit.stderr renamed to tests/ui/consts/miri_unleashed/const_refers_to_static.stderr

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,61 @@
11
error[E0080]: evaluation of constant value failed
2-
--> $DIR/const_refers_to_static.rs:9:5
2+
--> $DIR/const_refers_to_static.rs:10:5
33
|
44
LL | FOO.fetch_add(1, Ordering::Relaxed)
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ calling non-const function `AtomicUsize::fetch_add`
66

77
error[E0080]: evaluation of constant value failed
8-
--> $DIR/const_refers_to_static.rs:14:14
8+
--> $DIR/const_refers_to_static.rs:15:14
99
|
1010
LL | unsafe { *(&FOO as *const _ as *const usize) }
1111
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses mutable global memory
1212

1313
error[E0080]: evaluation of constant value failed
14-
--> $DIR/const_refers_to_static.rs:18:32
14+
--> $DIR/const_refers_to_static.rs:19:32
1515
|
1616
LL | const READ_MUT: u32 = unsafe { MUTABLE };
1717
| ^^^^^^^ constant accesses mutable global memory
1818

1919
error[E0080]: it is undefined behavior to use this value
20-
--> $DIR/const_refers_to_static.rs:21:1
20+
--> $DIR/const_refers_to_static.rs:22:1
2121
|
2222
LL | const REF_INTERIOR_MUT: &usize = {
2323
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered reference to mutable memory in `const`
2424
|
2525
= 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.
26-
= note: the raw bytes of the constant (size: 4, align: 4) {
27-
╾ALLOC0<imm>╼ │ ╾──╼
26+
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
27+
HEX_DUMP
2828
}
2929

3030
warning: skipping const checks
3131
|
3232
help: skipping check for `const_refs_to_static` feature
33-
--> $DIR/const_refers_to_static.rs:9:5
33+
--> $DIR/const_refers_to_static.rs:10:5
3434
|
3535
LL | FOO.fetch_add(1, Ordering::Relaxed)
3636
| ^^^
3737
help: skipping check that does not even have a feature gate
38-
--> $DIR/const_refers_to_static.rs:9:5
38+
--> $DIR/const_refers_to_static.rs:10:5
3939
|
4040
LL | FOO.fetch_add(1, Ordering::Relaxed)
4141
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4242
help: skipping check for `const_refs_to_static` feature
43-
--> $DIR/const_refers_to_static.rs:14:17
43+
--> $DIR/const_refers_to_static.rs:15:17
4444
|
4545
LL | unsafe { *(&FOO as *const _ as *const usize) }
4646
| ^^^
4747
help: skipping check for `const_refs_to_static` feature
48-
--> $DIR/const_refers_to_static.rs:18:32
48+
--> $DIR/const_refers_to_static.rs:19:32
4949
|
5050
LL | const READ_MUT: u32 = unsafe { MUTABLE };
5151
| ^^^^^^^
5252
help: skipping check for `const_refs_to_static` feature
53-
--> $DIR/const_refers_to_static.rs:24:18
53+
--> $DIR/const_refers_to_static.rs:25:18
5454
|
5555
LL | unsafe { &*(&FOO as *const _ as *const usize) }
5656
| ^^^
5757
help: skipping check for `const_refs_to_static` feature
58-
--> $DIR/const_refers_to_static.rs:29:25
58+
--> $DIR/const_refers_to_static.rs:30:25
5959
|
6060
LL | const REF_IMMUT: &u8 = &MY_STATIC;
6161
| ^^^^^^^^^

0 commit comments

Comments
 (0)