Normalize being an annoying little compile test

The issue-112505-overflow test just extended a case of transmute-fail.rs
so simply put them in the same file.

Then we normalize away other cases of this.
This commit is contained in:
Jubilee Young 2024-09-19 16:44:36 -07:00
parent 65f132fd25
commit 28628f3743
7 changed files with 41 additions and 40 deletions

View File

@ -552,7 +552,6 @@ ui/const-generics/infer/issue-77092.rs
ui/const-generics/issue-102124.rs
ui/const-generics/issue-105689.rs
ui/const-generics/issue-106419-struct-with-multiple-const-params.rs
ui/const-generics/issue-112505-overflow.rs
ui/const-generics/issue-46511.rs
ui/const-generics/issue-66451.rs
ui/const-generics/issue-70408.rs

View File

@ -1,7 +0,0 @@
#![feature(transmute_generic_consts)]
fn overflow(v: [[[u32; 8888888]; 9999999]; 777777777]) -> [[[u32; 9999999]; 777777777]; 239] {
unsafe { std::mem::transmute(v) } //~ ERROR cannot transmute between types of different sizes
}
fn main() { }

View File

@ -1,12 +0,0 @@
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
--> $DIR/issue-112505-overflow.rs:4:14
|
LL | unsafe { std::mem::transmute(v) }
| ^^^^^^^^^^^^^^^^^^^
|
= note: source type: `[[[u32; 8888888]; 9999999]; 777777777]` (values of the type `[[[u32; 8888888]; 9999999]; 777777777]` are too big for the current architecture)
= note: target type: `[[[u32; 9999999]; 777777777]; 239]` (values of the type `[[[u32; 9999999]; 777777777]; 239]` are too big for the current architecture)
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0512`.

View File

@ -1,3 +1,8 @@
// 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"
#![feature(transmute_generic_consts)]
#![feature(generic_const_exprs)]
#![allow(incomplete_features)]
@ -31,6 +36,11 @@
}
}
fn overflow_more(v: [[[u32; 8888888]; 9999999]; 777777777]) -> [[[u32; 9999999]; 777777777]; 239] {
unsafe { std::mem::transmute(v) } //~ ERROR cannot transmute between types of different sizes
}
fn transpose<const W: usize, const H: usize>(v: [[u32; H]; W]) -> [[u32; W]; H] {
unsafe {
std::mem::transmute(v)

View File

@ -1,11 +1,11 @@
error: the constant `W` is not of type `usize`
--> $DIR/transmute-fail.rs:12:42
--> $DIR/transmute-fail.rs:17: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:7:9
--> $DIR/transmute-fail.rs:12:9
|
LL | std::mem::transmute(v)
| ^^^^^^^^^^^^^^^^^^^
@ -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:15:9
--> $DIR/transmute-fail.rs:20: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:22:9
--> $DIR/transmute-fail.rs:27:9
|
LL | std::mem::transmute(v)
| ^^^^^^^^^^^^^^^^^^^
@ -29,16 +29,25 @@ 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:29:9
--> $DIR/transmute-fail.rs:34:9
|
LL | std::mem::transmute(v)
| ^^^^^^^^^^^^^^^^^^^
|
= note: source type: `[[[u32; 8888888]; 9999999]; 777777777]` (values of the type `[[[u32; 8888888]; 9999999]; 777777777]` are too big for the current architecture)
= note: target type: `[[[u32; 9999999]; 777777777]; 8888888]` (values of the type `[[[u32; 9999999]; 777777777]; 8888888]` are too big for the current architecture)
= note: source type: `[[[u32; 8888888]; 9999999]; 777777777]` (values of the type $REALLY_TOO_BIG are too big for the current architecture)
= note: target type: `[[[u32; 9999999]; 777777777]; 8888888]` (values of the type $REALLY_TOO_BIG are too big for the current architecture)
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
--> $DIR/transmute-fail.rs:36:9
--> $DIR/transmute-fail.rs:40:14
|
LL | unsafe { std::mem::transmute(v) }
| ^^^^^^^^^^^^^^^^^^^
|
= note: source type: `[[[u32; 8888888]; 9999999]; 777777777]` (values of the type $REALLY_TOO_BIG are too big for the current architecture)
= note: target type: `[[[u32; 9999999]; 777777777]; 239]` (values of the type $REALLY_TOO_BIG are too big for the current architecture)
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
--> $DIR/transmute-fail.rs:46:9
|
LL | std::mem::transmute(v)
| ^^^^^^^^^^^^^^^^^^^
@ -47,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:47:9
--> $DIR/transmute-fail.rs:57:9
|
LL | std::mem::transmute(v)
| ^^^^^^^^^^^^^^^^^^^
@ -56,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:54:9
--> $DIR/transmute-fail.rs:64:9
|
LL | std::mem::transmute(v)
| ^^^^^^^^^^^^^^^^^^^
@ -65,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:63:9
--> $DIR/transmute-fail.rs:73:9
|
LL | std::mem::transmute(v)
| ^^^^^^^^^^^^^^^^^^^
@ -74,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:72:9
--> $DIR/transmute-fail.rs:82:9
|
LL | std::mem::transmute(v)
| ^^^^^^^^^^^^^^^^^^^
@ -83,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:79:9
--> $DIR/transmute-fail.rs:89:9
|
LL | std::mem::transmute(v)
| ^^^^^^^^^^^^^^^^^^^
@ -92,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:86:9
--> $DIR/transmute-fail.rs:96:9
|
LL | std::mem::transmute(v)
| ^^^^^^^^^^^^^^^^^^^
@ -101,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:93:9
--> $DIR/transmute-fail.rs:103:9
|
LL | std::mem::transmute(v)
| ^^^^^^^^^^^^^^^^^^^
@ -110,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:102:9
--> $DIR/transmute-fail.rs:112:9
|
LL | std::mem::transmute(v)
| ^^^^^^^^^^^^^^^^^^^
@ -118,6 +127,6 @@ LL | std::mem::transmute(v)
= note: source type: `[[u32; 2 * H]; W + W]` (size can vary because of [u32; 2 * H])
= note: target type: `[[u32; W + W]; 2 * H]` (size can vary because of [u32; W + W])
error: aborting due to 14 previous errors
error: aborting due to 15 previous errors
For more information about this error, try `rustc --explain E0512`.

View File

@ -1,7 +1,9 @@
// ignore-tidy-linelength
//@ build-fail
//@ normalize-stderr-test: "S32" -> "SXX"
//@ normalize-stderr-test: "S1M" -> "SXX"
//@ error-pattern: too big for the current
//@ 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"
struct S32<T> {
v0: T,

View File

@ -1,5 +1,5 @@
error: values of the type `SXX<SXX<S1k<SXX<SXX<u32>>>>>` are too big for the current architecture
--> $DIR/huge-struct.rs:46:9
error: values of the type $REALLY_TOO_BIG are too big for the current architecture
--> $DIR/huge-struct.rs:48:9
|
LL | let fat: Option<SXX<SXX<SXX<u32>>>> = None;
| ^^^