-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
0fd50f3
commit 24c2c07
Showing
7 changed files
with
50 additions
and
34 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: 0 additions & 1 deletion
1
tests/ui/consts/auxiliary/foreign-generic-mismatch-with-const-arg.rs
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
21 changes: 0 additions & 21 deletions
21
tests/ui/consts/foreign-generic-mismatch-with-const-arg.stderr
This file was deleted.
Oops, something went wrong.
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,3 @@ | ||
pub fn const_arg<const N: usize, T>() {} | ||
|
||
pub fn lt_arg<'a: 'a>() {} |
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,10 @@ | ||
// aux-build: foreign-generic-mismatch.rs | ||
|
||
extern crate foreign_generic_mismatch; | ||
|
||
fn main() { | ||
foreign_generic_mismatch::const_arg::<()>(); | ||
//~^ ERROR function takes 2 generic arguments but 1 generic argument was supplied | ||
foreign_generic_mismatch::lt_arg::<'static, 'static>(); | ||
//~^ ERROR function takes 1 lifetime argument but 2 lifetime arguments were supplied | ||
} |
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,35 @@ | ||
error[E0107]: function takes 2 generic arguments but 1 generic argument was supplied | ||
--> $DIR/foreign-generic-mismatch.rs:6:31 | ||
| | ||
LL | foreign_generic_mismatch::const_arg::<()>(); | ||
| ^^^^^^^^^ -- supplied 1 generic argument | ||
| | | ||
| expected 2 generic arguments | ||
| | ||
note: function defined here, with 2 generic parameters: `N`, `T` | ||
--> $DIR/auxiliary/foreign-generic-mismatch.rs:1:8 | ||
| | ||
LL | pub fn const_arg<const N: usize, T>() {} | ||
| ^^^^^^^^^ -------------- - | ||
help: add missing generic argument | ||
| | ||
LL | foreign_generic_mismatch::const_arg::<(), T>(); | ||
| +++ | ||
|
||
error[E0107]: function takes 1 lifetime argument but 2 lifetime arguments were supplied | ||
--> $DIR/foreign-generic-mismatch.rs:8:31 | ||
| | ||
LL | foreign_generic_mismatch::lt_arg::<'static, 'static>(); | ||
| ^^^^^^ ------- help: remove this lifetime argument | ||
| | | ||
| expected 1 lifetime argument | ||
| | ||
note: function defined here, with 1 lifetime parameter: `'a` | ||
--> $DIR/auxiliary/foreign-generic-mismatch.rs:3:8 | ||
| | ||
LL | pub fn lt_arg<'a: 'a>() {} | ||
| ^^^^^^ -- | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0107`. |