Skip to content

Commit

Permalink
Add regression tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SkiFire13 committed Aug 3, 2021
1 parent 2fd874d commit ae313da
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
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");
}
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
}
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`.

0 comments on commit ae313da

Please sign in to comment.