Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compiletest: Remove the -test suffix from normalize directives #134759

Merged
merged 3 commits into from
Dec 27, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Simplify or delete normalize directives that don't care about bit-width
  • Loading branch information
Zalathar committed Dec 27, 2024
commit d997bc998e6522e86d04b210cef88e0e78b77ef6
3 changes: 1 addition & 2 deletions tests/ui/const-generics/transmute-fail.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// ignore-tidy-linelength
//@ normalize-stderr-32bit: "values of the type `[^`]+` are too big" -> "values of the type $$REALLY_TOO_BIG are too big"
//@ normalize-stderr-64bit: "values of the type `[^`]+` are too big" -> "values of the type $$REALLY_TOO_BIG are too big"
//@ normalize-stderr-test: "values of the type `[^`]+` are too big" -> "values of the type $$REALLY_TOO_BIG are too big"


#![feature(transmute_generic_consts)]
Expand Down
30 changes: 15 additions & 15 deletions tests/ui/const-generics/transmute-fail.stderr
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
error: the constant `W` is not of type `usize`
--> $DIR/transmute-fail.rs:17:42
--> $DIR/transmute-fail.rs:16:42
|
LL | fn bar<const W: bool, const H: usize>(v: [[u32; H]; W]) -> [[u32; W]; H] {
| ^^^^^^^^^^^^^ expected `usize`, found `bool`

error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
--> $DIR/transmute-fail.rs:12:9
--> $DIR/transmute-fail.rs:11:9
|
LL | std::mem::transmute(v)
| ^^^^^^^^^^^^^^^^^^^
Expand All @@ -14,13 +14,13 @@ LL | std::mem::transmute(v)
= note: target type: `[[u32; W + 1]; H]` (size can vary because of [u32; W + 1])

error: the constant `W` is not of type `usize`
--> $DIR/transmute-fail.rs:20:9
--> $DIR/transmute-fail.rs:19:9
|
LL | std::mem::transmute(v)
| ^^^^^^^^^^^^^^^^^^^ expected `usize`, found `bool`

error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
--> $DIR/transmute-fail.rs:27:9
--> $DIR/transmute-fail.rs:26:9
|
LL | std::mem::transmute(v)
| ^^^^^^^^^^^^^^^^^^^
Expand All @@ -29,7 +29,7 @@ LL | std::mem::transmute(v)
= note: target type: `[u32; W * H * H]` (this type does not have a fixed size)

error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
--> $DIR/transmute-fail.rs:34:9
--> $DIR/transmute-fail.rs:33:9
|
LL | std::mem::transmute(v)
| ^^^^^^^^^^^^^^^^^^^
Expand All @@ -38,7 +38,7 @@ LL | std::mem::transmute(v)
= note: target type: `[[[u32; 9999999]; 777777777]; 8888888]` (values of the type $REALLY_TOO_BIG are too big for the target architecture)

error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
--> $DIR/transmute-fail.rs:40:14
--> $DIR/transmute-fail.rs:39:14
|
LL | unsafe { std::mem::transmute(v) }
| ^^^^^^^^^^^^^^^^^^^
Expand All @@ -47,7 +47,7 @@ LL | unsafe { std::mem::transmute(v) }
= note: target type: `[[[u32; 9999999]; 777777777]; 239]` (values of the type $REALLY_TOO_BIG are too big for the target architecture)

error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
--> $DIR/transmute-fail.rs:46:9
--> $DIR/transmute-fail.rs:45:9
|
LL | std::mem::transmute(v)
| ^^^^^^^^^^^^^^^^^^^
Expand All @@ -56,7 +56,7 @@ LL | std::mem::transmute(v)
= note: target type: `[[u32; W]; H]` (size can vary because of [u32; W])

error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
--> $DIR/transmute-fail.rs:57:9
--> $DIR/transmute-fail.rs:56:9
|
LL | std::mem::transmute(v)
| ^^^^^^^^^^^^^^^^^^^
Expand All @@ -65,7 +65,7 @@ LL | std::mem::transmute(v)
= note: target type: `[u32; W * H]` (this type does not have a fixed size)

error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
--> $DIR/transmute-fail.rs:64:9
--> $DIR/transmute-fail.rs:63:9
|
LL | std::mem::transmute(v)
| ^^^^^^^^^^^^^^^^^^^
Expand All @@ -74,7 +74,7 @@ LL | std::mem::transmute(v)
= note: target type: `[[u32; W]; H]` (size can vary because of [u32; W])

error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
--> $DIR/transmute-fail.rs:73:9
--> $DIR/transmute-fail.rs:72:9
|
LL | std::mem::transmute(v)
| ^^^^^^^^^^^^^^^^^^^
Expand All @@ -83,7 +83,7 @@ LL | std::mem::transmute(v)
= note: target type: `[u32; D * W * H]` (this type does not have a fixed size)

error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
--> $DIR/transmute-fail.rs:82:9
--> $DIR/transmute-fail.rs:81:9
|
LL | std::mem::transmute(v)
| ^^^^^^^^^^^^^^^^^^^
Expand All @@ -92,7 +92,7 @@ LL | std::mem::transmute(v)
= note: target type: `[[u32; D * W]; H]` (size can vary because of [u32; D * W])

error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
--> $DIR/transmute-fail.rs:89:9
--> $DIR/transmute-fail.rs:88:9
|
LL | std::mem::transmute(v)
| ^^^^^^^^^^^^^^^^^^^
Expand All @@ -101,7 +101,7 @@ LL | std::mem::transmute(v)
= note: target type: `[u8; L * 2]` (this type does not have a fixed size)

error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
--> $DIR/transmute-fail.rs:96:9
--> $DIR/transmute-fail.rs:95:9
|
LL | std::mem::transmute(v)
| ^^^^^^^^^^^^^^^^^^^
Expand All @@ -110,7 +110,7 @@ LL | std::mem::transmute(v)
= note: target type: `[u16; L]` (this type does not have a fixed size)

error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
--> $DIR/transmute-fail.rs:103:9
--> $DIR/transmute-fail.rs:102:9
|
LL | std::mem::transmute(v)
| ^^^^^^^^^^^^^^^^^^^
Expand All @@ -119,7 +119,7 @@ LL | std::mem::transmute(v)
= note: target type: `[[u8; 1]; L]` (this type does not have a fixed size)

error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
--> $DIR/transmute-fail.rs:112:9
--> $DIR/transmute-fail.rs:111:9
|
LL | std::mem::transmute(v)
| ^^^^^^^^^^^^^^^^^^^
Expand Down
3 changes: 1 addition & 2 deletions tests/ui/consts/issue-17718-const-bad-values.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//@ normalize-stderr-32bit: "\(size: \d+, align: \d+\)" -> "(size: $$PTR, align: $$PTR)"
//@ normalize-stderr-64bit: "\(size: \d+, align: \d+\)" -> "(size: $$PTR, align: $$PTR)"
//@ normalize-stderr-test: "\(size: \d+, align: \d+\)" -> "(size: $$PTR, align: $$PTR)"
//@ normalize-stderr-test: "([0-9a-f][0-9a-f] |╾─*A(LLOC)?[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"

#![allow(static_mut_refs)]
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/consts/issue-17718-const-bad-values.stderr
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
error[E0764]: mutable references are not allowed in the final value of constants
--> $DIR/issue-17718-const-bad-values.rs:7:34
--> $DIR/issue-17718-const-bad-values.rs:6:34
|
LL | const C1: &'static mut [usize] = &mut [];
| ^^^^^^^

error[E0080]: it is undefined behavior to use this value
--> $DIR/issue-17718-const-bad-values.rs:11:1
--> $DIR/issue-17718-const-bad-values.rs:10:1
|
LL | const C2: &'static mut i32 = unsafe { &mut S };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered reference to mutable memory in `const`
Expand Down
2 changes: 0 additions & 2 deletions tests/ui/debuginfo/debuginfo-type-name-layout-ice-94961-1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
//@ compile-flags:-C debuginfo=2
//@ build-fail
//@ error-pattern: too big for the target architecture
//@ normalize-stderr-64bit: "18446744073709551615" -> "SIZE"
//@ normalize-stderr-32bit: "4294967295" -> "SIZE"
Comment on lines -7 to -8
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fun fact, this hasn't needed normalization since #106873.


#![crate_type = "rlib"]

Expand Down
2 changes: 0 additions & 2 deletions tests/ui/debuginfo/debuginfo-type-name-layout-ice-94961-2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
//@ compile-flags:-C debuginfo=2
//@ build-fail
//@ error-pattern: too big for the target architecture
//@ normalize-stderr-64bit: "18446744073709551615" -> "SIZE"
//@ normalize-stderr-32bit: "4294967295" -> "SIZE"

#![crate_type = "rlib"]

Expand Down
3 changes: 1 addition & 2 deletions tests/ui/limits/huge-struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
//@ build-fail
//@ normalize-stderr-test: "S32" -> "SXX"
//@ normalize-stderr-test: "S1M" -> "SXX"
//@ normalize-stderr-32bit: "values of the type `[^`]+` are too big" -> "values of the type $$REALLY_TOO_BIG are too big"
//@ normalize-stderr-64bit: "values of the type `[^`]+` are too big" -> "values of the type $$REALLY_TOO_BIG are too big"
//@ normalize-stderr-test: "values of the type `[^`]+` are too big" -> "values of the type $$REALLY_TOO_BIG are too big"

struct S32<T> {
v0: T,
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/limits/huge-struct.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: values of the type $REALLY_TOO_BIG are too big for the target architecture
--> $DIR/huge-struct.rs:48:9
--> $DIR/huge-struct.rs:47:9
|
LL | let fat: Option<SXX<SXX<SXX<u32>>>> = None;
| ^^^
Expand Down
2 changes: 0 additions & 2 deletions tests/ui/limits/issue-55878.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
//@ build-fail
//@ normalize-stderr-64bit: "18446744073709551615" -> "SIZE"
//@ normalize-stderr-32bit: "4294967295" -> "SIZE"

//@ error-pattern: are too big for the target architecture
fn main() {
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/limits/issue-55878.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ error[E0080]: evaluation of constant value failed
note: inside `std::mem::size_of::<[u8; usize::MAX]>`
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL
note: inside `main`
--> $DIR/issue-55878.rs:7:26
--> $DIR/issue-55878.rs:5:26
|
LL | println!("Size: {}", std::mem::size_of::<[u8; u64::MAX as usize]>());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down