-
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.
- Loading branch information
1 parent
8a778ca
commit 1ee189c
Showing
4 changed files
with
32 additions
and
2 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
1 change: 1 addition & 0 deletions
1
tests/ui/consts/auxiliary/foreign-generic-mismatch-with-const-arg.rs
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 @@ | ||
pub fn test<const N: usize, T>() {} |
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,8 @@ | ||
// aux-build: foreign-generic-mismatch-with-const-arg.rs | ||
|
||
extern crate foreign_generic_mismatch_with_const_arg; | ||
|
||
fn main() { | ||
foreign_generic_mismatch_with_const_arg::test::<1>(); | ||
//~^ ERROR function takes 2 generic arguments but 1 generic argument was supplied | ||
} |
21 changes: 21 additions & 0 deletions
21
tests/ui/consts/foreign-generic-mismatch-with-const-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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
error[E0107]: function takes 2 generic arguments but 1 generic argument was supplied | ||
--> $DIR/foreign-generic-mismatch-with-const-arg.rs:6:46 | ||
| | ||
LL | foreign_generic_mismatch_with_const_arg::test::<1>(); | ||
| ^^^^ - supplied 1 generic argument | ||
| | | ||
| expected 2 generic arguments | ||
| | ||
note: function defined here, with 2 generic parameters: `N`, `T` | ||
--> $DIR/auxiliary/foreign-generic-mismatch-with-const-arg.rs:1:8 | ||
| | ||
LL | pub fn test<const N: usize, T>() {} | ||
| ^^^^ -------------- - | ||
help: add missing generic argument | ||
| | ||
LL | foreign_generic_mismatch_with_const_arg::test::<1, T>(); | ||
| +++ | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0107`. |