From c17a7057580fcd76caec41939f1c4d5534ff790e Mon Sep 17 00:00:00 2001 From: Matthew Jasper Date: Sat, 8 Apr 2023 22:14:57 +0100 Subject: [PATCH] Add test for new delayed bug code path --- tests/ui/simd/monomorphize-heterogeneous.rs | 9 +++++++++ tests/ui/simd/monomorphize-heterogeneous.stderr | 9 +++++++++ 2 files changed, 18 insertions(+) create mode 100644 tests/ui/simd/monomorphize-heterogeneous.rs create mode 100644 tests/ui/simd/monomorphize-heterogeneous.stderr diff --git a/tests/ui/simd/monomorphize-heterogeneous.rs b/tests/ui/simd/monomorphize-heterogeneous.rs new file mode 100644 index 0000000000000..42e380dbb779b --- /dev/null +++ b/tests/ui/simd/monomorphize-heterogeneous.rs @@ -0,0 +1,9 @@ +#![feature(repr_simd)] + +#[repr(simd)] +struct I64F64(i64, f64); +//~^ ERROR SIMD vector should be homogeneous + +static X: I64F64 = I64F64(1, 2.0); + +fn main() {} diff --git a/tests/ui/simd/monomorphize-heterogeneous.stderr b/tests/ui/simd/monomorphize-heterogeneous.stderr new file mode 100644 index 0000000000000..e7b41cd787cd2 --- /dev/null +++ b/tests/ui/simd/monomorphize-heterogeneous.stderr @@ -0,0 +1,9 @@ +error[E0076]: SIMD vector should be homogeneous + --> $DIR/monomorphize-heterogeneous.rs:4:1 + | +LL | struct I64F64(i64, f64); + | ^^^^^^^^^^^^^ SIMD elements must have the same type + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0076`.