forked from rust-lang/rust
-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
3 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/issue-87718.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,9 @@ | ||
// check-pass | ||
|
||
#![feature(explicit_generic_args_with_impl_trait)] | ||
|
||
fn f<T: ?Sized>(_: impl AsRef<T>, _: impl AsRef<T>) {} | ||
|
||
fn main() { | ||
f::<[u8]>("a", b"a"); | ||
} |
8 changes: 8 additions & 0 deletions
8
src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/not-enough-args.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,8 @@ | ||
#![feature(explicit_generic_args_with_impl_trait)] | ||
|
||
fn f<T: ?Sized, U: ?Sized>(_: impl AsRef<T>, _: impl AsRef<U>) {} | ||
|
||
fn main() { | ||
f::<[u8]>("a", b"a"); | ||
//~^ ERROR: this function takes 2 generic arguments but 1 generic argument was supplied | ||
} |
21 changes: 21 additions & 0 deletions
21
src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/not-enough-args.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]: this function takes 2 generic arguments but 1 generic argument was supplied | ||
--> $DIR/not-enough-args.rs:6:5 | ||
| | ||
LL | f::<[u8]>("a", b"a"); | ||
| ^ ---- supplied 1 generic argument | ||
| | | ||
| expected 2 generic arguments | ||
| | ||
note: function defined here, with 2 generic parameters: `T`, `U` | ||
--> $DIR/not-enough-args.rs:3:4 | ||
| | ||
LL | fn f<T: ?Sized, U: ?Sized>(_: impl AsRef<T>, _: impl AsRef<U>) {} | ||
| ^ - - | ||
help: add missing generic argument | ||
| | ||
LL | f::<[u8], U>("a", b"a"); | ||
| ^^^ | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0107`. |