-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check the number of generic lifetime and const parameters of intrinsics
- Loading branch information
1 parent
a50d721
commit 7b2befc
Showing
5 changed files
with
116 additions
and
28 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
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Check that appropriate errors are reported if an intrinsic is defined | ||
// with the wrong number of generic lifetime/type/const parameters, and | ||
// that no ICE occurs in these cases. | ||
|
||
#![feature(platform_intrinsics)] | ||
#![crate_type="lib"] | ||
|
||
extern "platform-intrinsic" { | ||
fn simd_saturating_add<'a, T: 'a>(x: T, y: T); | ||
//~^ ERROR: intrinsic has wrong number of lifetime parameters | ||
|
||
fn simd_add<'a, T>(x: T, y: T); | ||
//~^ ERROR: intrinsic has wrong number of lifetime parameters | ||
|
||
fn simd_sub<T, U>(x: T, y: U); | ||
//~^ ERROR: intrinsic has wrong number of type parameters | ||
|
||
fn simd_mul<T, const N: usize>(x: T, y: T); | ||
//~^ ERROR: intrinsic has wrong number of const parameters | ||
} |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
error[E0094]: intrinsic has wrong number of lifetime parameters: found 1, expected 0 | ||
--> $DIR/issue-85855.rs:9:27 | ||
| | ||
LL | fn simd_saturating_add<'a, T: 'a>(x: T, y: T); | ||
| ^^^^^^^^^^^ expected 0 lifetime parameters | ||
|
||
error[E0094]: intrinsic has wrong number of lifetime parameters: found 1, expected 0 | ||
--> $DIR/issue-85855.rs:12:16 | ||
| | ||
LL | fn simd_add<'a, T>(x: T, y: T); | ||
| ^^^^^^^ expected 0 lifetime parameters | ||
|
||
error[E0094]: intrinsic has wrong number of type parameters: found 2, expected 1 | ||
--> $DIR/issue-85855.rs:15:16 | ||
| | ||
LL | fn simd_sub<T, U>(x: T, y: U); | ||
| ^^^^^^ expected 1 type parameter | ||
|
||
error[E0094]: intrinsic has wrong number of const parameters: found 1, expected 0 | ||
--> $DIR/issue-85855.rs:18:16 | ||
| | ||
LL | fn simd_mul<T, const N: usize>(x: T, y: T); | ||
| ^^^^^^^^^^^^^^^^^^^ expected 0 const parameters | ||
|
||
error: aborting due to 4 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0094`. |