-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add float testing and testing for wrapped arrays
- Loading branch information
1 parent
b44f6db
commit 9d7f9d0
Showing
6 changed files
with
140 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 22 additions & 14 deletions
36
tests/ui/internal-lints/rustc_intrinsic_const_vector_arg.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,76 @@ | ||
error: malformed `rustc_intrinsic_const_vector_arg` attribute input | ||
--> $DIR/rustc_intrinsic_const_vector_arg.rs:16:5 | ||
--> $DIR/rustc_intrinsic_const_vector_arg.rs:19:5 | ||
| | ||
LL | #[rustc_intrinsic_const_vector_arg] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[rustc_intrinsic_const_vector_arg(arg1_index, arg2_index, ...)]` | ||
|
||
error: malformed `rustc_intrinsic_const_vector_arg` attribute input | ||
--> $DIR/rustc_intrinsic_const_vector_arg.rs:21:5 | ||
--> $DIR/rustc_intrinsic_const_vector_arg.rs:24:5 | ||
| | ||
LL | #[rustc_intrinsic_const_vector_arg = "1"] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[rustc_intrinsic_const_vector_arg(arg1_index, arg2_index, ...)]` | ||
|
||
error: attribute should be applied to functions in `extern "unadjusted"` modules | ||
--> $DIR/rustc_intrinsic_const_vector_arg.rs:25:1 | ||
--> $DIR/rustc_intrinsic_const_vector_arg.rs:28:1 | ||
| | ||
LL | #[rustc_intrinsic_const_vector_arg(0)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
LL | pub struct foo3(i8x2); | ||
| ---------------------- not a function in an `extern "unadjusted"` module | ||
|
||
error: attribute should be applied to functions in `extern "unadjusted"` modules | ||
--> $DIR/rustc_intrinsic_const_vector_arg.rs:29:5 | ||
--> $DIR/rustc_intrinsic_const_vector_arg.rs:32:5 | ||
| | ||
LL | #[rustc_intrinsic_const_vector_arg(0)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
LL | fn foo4(a: i8x2); | ||
| ----------------- not a function in an `extern "unadjusted"` module | ||
|
||
error: function does not have a parameter at index 0 | ||
--> $DIR/rustc_intrinsic_const_vector_arg.rs:34:5 | ||
--> $DIR/rustc_intrinsic_const_vector_arg.rs:37:5 | ||
| | ||
LL | #[rustc_intrinsic_const_vector_arg(0)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
LL | fn foo5(); | ||
| ---------- function has 0 arguments | ||
|
||
error: function does not have a parameter at index 1 | ||
--> $DIR/rustc_intrinsic_const_vector_arg.rs:39:5 | ||
--> $DIR/rustc_intrinsic_const_vector_arg.rs:42:5 | ||
| | ||
LL | #[rustc_intrinsic_const_vector_arg(1)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
LL | fn foo6(a: i8x2); | ||
| ----------------- function has 1 arguments | ||
|
||
error: attribute requires a parameter index | ||
--> $DIR/rustc_intrinsic_const_vector_arg.rs:44:40 | ||
--> $DIR/rustc_intrinsic_const_vector_arg.rs:47:40 | ||
| | ||
LL | #[rustc_intrinsic_const_vector_arg("bar")] | ||
| ^^^^^ | ||
|
||
error: function does not have a parameter at index 2 | ||
--> $DIR/rustc_intrinsic_const_vector_arg.rs:49:5 | ||
--> $DIR/rustc_intrinsic_const_vector_arg.rs:52:5 | ||
| | ||
LL | #[rustc_intrinsic_const_vector_arg(0,2)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
LL | #[rustc_intrinsic_const_vector_arg(0, 2)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
LL | fn foo8(a: i8x2, b: i8); | ||
| ------------------------ function has 2 arguments | ||
|
||
error: parameter at index 0 must be a simd type | ||
--> $DIR/rustc_intrinsic_const_vector_arg.rs:54:5 | ||
error: parameter at index 0 must be a simd type defined in the local crate | ||
--> $DIR/rustc_intrinsic_const_vector_arg.rs:57:5 | ||
| | ||
LL | #[rustc_intrinsic_const_vector_arg(0)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
LL | fn foo9(a: i8); | ||
| -- parameter is a non-simd type | ||
| -- parameter is a non-simd type or is not defined locally | ||
|
||
error: aborting due to 9 previous errors | ||
error: parameter at index 0 must be a simd type defined in the local crate | ||
--> $DIR/rustc_intrinsic_const_vector_arg.rs:62:5 | ||
| | ||
LL | #[rustc_intrinsic_const_vector_arg(0)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
LL | fn foo10(a: Simd<i8, 2>); | ||
| ----------- parameter is a non-simd type or is not defined locally | ||
|
||
error: aborting due to 10 previous errors | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 28 additions & 10 deletions
38
tests/ui/internal-lints/rustc_intrinsic_const_vector_arg_calls.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,38 @@ | ||
error: argument at index 0 must be a constant | ||
--> $DIR/rustc_intrinsic_const_vector_arg_calls.rs:27:9 | ||
--> $DIR/rustc_intrinsic_const_vector_arg_calls.rs:54:9 | ||
| | ||
LL | foo1(i8x2(0,1)); | ||
| ^^^^^^^^^^^^^^^ | ||
LL | foo1(i8x2(0, 1)); | ||
| ^^^^^^^^^^^^^^^^ | ||
|
||
error: argument at index 0 must be a constant | ||
--> $DIR/rustc_intrinsic_const_vector_arg_calls.rs:28:9 | ||
--> $DIR/rustc_intrinsic_const_vector_arg_calls.rs:55:9 | ||
| | ||
LL | foo1({ i8x2(0,1) }); | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
LL | foo1({ i8x2(0, 1) }); | ||
| ^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: argument at index 1 must be a constant | ||
--> $DIR/rustc_intrinsic_const_vector_arg_calls.rs:31:9 | ||
--> $DIR/rustc_intrinsic_const_vector_arg_calls.rs:58:9 | ||
| | ||
LL | foo2(const { i8x2(0,1) }, { i8x2(2,3) }); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
LL | foo2(const { i8x2(0, 1) }, { i8x2(2, 3) }); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 3 previous errors | ||
error: argument at index 0 must be a constant | ||
--> $DIR/rustc_intrinsic_const_vector_arg_calls.rs:61:9 | ||
| | ||
LL | foo3(i8x2_arr([0, 1])); | ||
| ^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: argument at index 0 must be a constant | ||
--> $DIR/rustc_intrinsic_const_vector_arg_calls.rs:64:9 | ||
| | ||
LL | foo4(f32x2(0.0, 1.0)); | ||
| ^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: argument at index 0 must be a constant | ||
--> $DIR/rustc_intrinsic_const_vector_arg_calls.rs:67:9 | ||
| | ||
LL | foo5(f32x2_arr([0.0, 1.0])); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 6 previous errors | ||
|