Skip to content

Commit b43dc80

Browse files
Add #[rustc_args_required_const] to simd_shuffle tests
1 parent f581b55 commit b43dc80

7 files changed

+32
-20
lines changed

src/test/incremental/issue-61530.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
#![feature(repr_simd, platform_intrinsics)]
1+
#![feature(repr_simd, platform_intrinsics, rustc_attrs)]
22

33
// revisions:rpass1 rpass2
44

55
#[repr(simd)]
66
struct I32x2(i32, i32);
77

88
extern "platform-intrinsic" {
9+
#[rustc_args_required_const(2)]
910
fn simd_shuffle2<T, U>(x: T, y: T, idx: [u32; 2]) -> U;
1011
}
1112

src/test/ui/issues/issue-38074.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
// run-pass
22
// ignore-emscripten FIXME(#45351)
33

4-
#![feature(platform_intrinsics, repr_simd)]
4+
#![feature(platform_intrinsics, repr_simd, rustc_attrs)]
55

66
extern "platform-intrinsic" {
7+
#[rustc_args_required_const(2)]
78
fn simd_shuffle2<T, U>(x: T, y: T, idx: [u32; 2]) -> U;
89
}
910

src/test/ui/simd-intrinsic/simd-intrinsic-generic-elements.rs

+4
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,13 @@ extern "platform-intrinsic" {
4242
fn simd_insert<T, E>(x: T, idx: u32, y: E) -> T;
4343
fn simd_extract<T, E>(x: T, idx: u32) -> E;
4444

45+
#[rustc_args_required_const(2)]
4546
fn simd_shuffle2<T, U>(x: T, y: T, idx: [u32; 2]) -> U;
47+
#[rustc_args_required_const(2)]
4648
fn simd_shuffle3<T, U>(x: T, y: T, idx: [u32; 3]) -> U;
49+
#[rustc_args_required_const(2)]
4750
fn simd_shuffle4<T, U>(x: T, y: T, idx: [u32; 4]) -> U;
51+
#[rustc_args_required_const(2)]
4852
fn simd_shuffle8<T, U>(x: T, y: T, idx: [u32; 8]) -> U;
4953
}
5054

src/test/ui/simd-intrinsic/simd-intrinsic-generic-elements.stderr

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,89 @@
11
error[E0511]: invalid monomorphization of `simd_insert` intrinsic: expected SIMD input type, found non-SIMD `i32`
2-
--> $DIR/simd-intrinsic-generic-elements.rs:55:9
2+
--> $DIR/simd-intrinsic-generic-elements.rs:59:9
33
|
44
LL | simd_insert(0, 0, 0);
55
| ^^^^^^^^^^^^^^^^^^^^
66

77
error[E0511]: invalid monomorphization of `simd_insert` intrinsic: expected inserted type `i32` (element of input `i32x4`), found `f64`
8-
--> $DIR/simd-intrinsic-generic-elements.rs:57:9
8+
--> $DIR/simd-intrinsic-generic-elements.rs:61:9
99
|
1010
LL | simd_insert(x, 0, 1.0);
1111
| ^^^^^^^^^^^^^^^^^^^^^^
1212

1313
error[E0511]: invalid monomorphization of `simd_extract` intrinsic: expected return type `i32` (element of input `i32x4`), found `f32`
14-
--> $DIR/simd-intrinsic-generic-elements.rs:59:9
14+
--> $DIR/simd-intrinsic-generic-elements.rs:63:9
1515
|
1616
LL | simd_extract::<_, f32>(x, 0);
1717
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1818

1919
error[E0511]: invalid monomorphization of `simd_shuffle2` intrinsic: expected SIMD input type, found non-SIMD `i32`
20-
--> $DIR/simd-intrinsic-generic-elements.rs:62:9
20+
--> $DIR/simd-intrinsic-generic-elements.rs:66:9
2121
|
2222
LL | simd_shuffle2::<i32, i32>(0, 0, [0; 2]);
2323
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2424

2525
error[E0511]: invalid monomorphization of `simd_shuffle3` intrinsic: expected SIMD input type, found non-SIMD `i32`
26-
--> $DIR/simd-intrinsic-generic-elements.rs:64:9
26+
--> $DIR/simd-intrinsic-generic-elements.rs:68:9
2727
|
2828
LL | simd_shuffle3::<i32, i32>(0, 0, [0; 3]);
2929
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3030

3131
error[E0511]: invalid monomorphization of `simd_shuffle4` intrinsic: expected SIMD input type, found non-SIMD `i32`
32-
--> $DIR/simd-intrinsic-generic-elements.rs:66:9
32+
--> $DIR/simd-intrinsic-generic-elements.rs:70:9
3333
|
3434
LL | simd_shuffle4::<i32, i32>(0, 0, [0; 4]);
3535
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3636

3737
error[E0511]: invalid monomorphization of `simd_shuffle8` intrinsic: expected SIMD input type, found non-SIMD `i32`
38-
--> $DIR/simd-intrinsic-generic-elements.rs:68:9
38+
--> $DIR/simd-intrinsic-generic-elements.rs:72:9
3939
|
4040
LL | simd_shuffle8::<i32, i32>(0, 0, [0; 8]);
4141
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4242

4343
error[E0511]: invalid monomorphization of `simd_shuffle2` intrinsic: expected return element type `i32` (element of input `i32x4`), found `f32x2` with element type `f32`
44-
--> $DIR/simd-intrinsic-generic-elements.rs:71:9
44+
--> $DIR/simd-intrinsic-generic-elements.rs:75:9
4545
|
4646
LL | simd_shuffle2::<_, f32x2>(x, x, [0; 2]);
4747
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4848

4949
error[E0511]: invalid monomorphization of `simd_shuffle3` intrinsic: expected return element type `i32` (element of input `i32x4`), found `f32x3` with element type `f32`
50-
--> $DIR/simd-intrinsic-generic-elements.rs:73:9
50+
--> $DIR/simd-intrinsic-generic-elements.rs:77:9
5151
|
5252
LL | simd_shuffle3::<_, f32x3>(x, x, [0; 3]);
5353
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5454

5555
error[E0511]: invalid monomorphization of `simd_shuffle4` intrinsic: expected return element type `i32` (element of input `i32x4`), found `f32x4` with element type `f32`
56-
--> $DIR/simd-intrinsic-generic-elements.rs:75:9
56+
--> $DIR/simd-intrinsic-generic-elements.rs:79:9
5757
|
5858
LL | simd_shuffle4::<_, f32x4>(x, x, [0; 4]);
5959
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6060

6161
error[E0511]: invalid monomorphization of `simd_shuffle8` intrinsic: expected return element type `i32` (element of input `i32x4`), found `f32x8` with element type `f32`
62-
--> $DIR/simd-intrinsic-generic-elements.rs:77:9
62+
--> $DIR/simd-intrinsic-generic-elements.rs:81:9
6363
|
6464
LL | simd_shuffle8::<_, f32x8>(x, x, [0; 8]);
6565
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6666

6767
error[E0511]: invalid monomorphization of `simd_shuffle2` intrinsic: expected return type of length 2, found `i32x8` with length 8
68-
--> $DIR/simd-intrinsic-generic-elements.rs:80:9
68+
--> $DIR/simd-intrinsic-generic-elements.rs:84:9
6969
|
7070
LL | simd_shuffle2::<_, i32x8>(x, x, [0; 2]);
7171
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7272

7373
error[E0511]: invalid monomorphization of `simd_shuffle3` intrinsic: expected return type of length 3, found `i32x4` with length 4
74-
--> $DIR/simd-intrinsic-generic-elements.rs:82:9
74+
--> $DIR/simd-intrinsic-generic-elements.rs:86:9
7575
|
7676
LL | simd_shuffle3::<_, i32x4>(x, x, [0; 3]);
7777
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7878

7979
error[E0511]: invalid monomorphization of `simd_shuffle4` intrinsic: expected return type of length 4, found `i32x3` with length 3
80-
--> $DIR/simd-intrinsic-generic-elements.rs:84:9
80+
--> $DIR/simd-intrinsic-generic-elements.rs:88:9
8181
|
8282
LL | simd_shuffle4::<_, i32x3>(x, x, [0; 4]);
8383
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8484

8585
error[E0511]: invalid monomorphization of `simd_shuffle8` intrinsic: expected return type of length 8, found `i32x2` with length 2
86-
--> $DIR/simd-intrinsic-generic-elements.rs:86:9
86+
--> $DIR/simd-intrinsic-generic-elements.rs:90:9
8787
|
8888
LL | simd_shuffle8::<_, i32x2>(x, x, [0; 8]);
8989
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/test/ui/simd-intrinsic/simd-intrinsic-inlining-issue67557-ice.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
//
44
// run-pass
55
// compile-flags: -Zmir-opt-level=3
6-
#![feature(platform_intrinsics, repr_simd)]
6+
#![feature(platform_intrinsics, repr_simd, rustc_attrs)]
77

88
extern "platform-intrinsic" {
9+
#[rustc_args_required_const(2)]
910
fn simd_shuffle2<T, U>(x: T, y: T, idx: [u32; 2]) -> U;
1011
}
1112

src/test/ui/simd-intrinsic/simd-intrinsic-inlining-issue67557.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
//
44
// run-pass
55
// compile-flags: -Zmir-opt-level=3
6-
#![feature(platform_intrinsics, repr_simd)]
6+
#![feature(platform_intrinsics, repr_simd, rustc_attrs)]
77

88
extern "platform-intrinsic" {
9+
#[rustc_args_required_const(2)]
910
fn simd_shuffle2<T, U>(x: T, y: T, idx: [u32; 2]) -> U;
1011
}
1112

src/test/ui/simd/simd-intrinsic-generic-elements.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// run-pass
22
// ignore-emscripten FIXME(#45351) hits an LLVM assert
33

4-
#![feature(repr_simd, platform_intrinsics)]
4+
#![feature(repr_simd, platform_intrinsics, rustc_attrs)]
55

66
#[repr(simd)]
77
#[derive(Copy, Clone, Debug, PartialEq)]
@@ -25,9 +25,13 @@ extern "platform-intrinsic" {
2525
fn simd_insert<T, E>(x: T, idx: u32, y: E) -> T;
2626
fn simd_extract<T, E>(x: T, idx: u32) -> E;
2727

28+
#[rustc_args_required_const(2)]
2829
fn simd_shuffle2<T, U>(x: T, y: T, idx: [u32; 2]) -> U;
30+
#[rustc_args_required_const(2)]
2931
fn simd_shuffle3<T, U>(x: T, y: T, idx: [u32; 3]) -> U;
32+
#[rustc_args_required_const(2)]
3033
fn simd_shuffle4<T, U>(x: T, y: T, idx: [u32; 4]) -> U;
34+
#[rustc_args_required_const(2)]
3135
fn simd_shuffle8<T, U>(x: T, y: T, idx: [u32; 8]) -> U;
3236
}
3337

0 commit comments

Comments
 (0)