Report all errors in check_generic_arg_count

This commit is contained in:
varkor 2020-01-20 23:59:17 +00:00
parent 2a504878c3
commit d232acdb39
3 changed files with 81 additions and 85 deletions

View file

@ -4,7 +4,6 @@ struct Bar<'a>(&'a ());
fn main() {
Foo::<'static, 'static, ()>(&0); //~ ERROR wrong number of lifetime arguments
//~^ ERROR mismatched types
Bar::<'static, 'static, ()>(&()); //~ ERROR wrong number of lifetime arguments
//~^ ERROR wrong number of type arguments

View file

@ -4,28 +4,18 @@ error[E0107]: wrong number of lifetime arguments: expected 1, found 2
LL | Foo::<'static, 'static, ()>(&0);
| ^^^^^^^ unexpected lifetime argument
error[E0308]: mismatched types
--> $DIR/generic-arg-mismatch-recover.rs:6:33
|
LL | Foo::<'static, 'static, ()>(&0);
| ^^ expected `()`, found integer
|
= note: expected reference `&'static ()`
found reference `&{integer}`
error[E0107]: wrong number of lifetime arguments: expected 1, found 2
--> $DIR/generic-arg-mismatch-recover.rs:9:20
--> $DIR/generic-arg-mismatch-recover.rs:8:20
|
LL | Bar::<'static, 'static, ()>(&());
| ^^^^^^^ unexpected lifetime argument
error[E0107]: wrong number of type arguments: expected 0, found 1
--> $DIR/generic-arg-mismatch-recover.rs:9:29
--> $DIR/generic-arg-mismatch-recover.rs:8:29
|
LL | Bar::<'static, 'static, ()>(&());
| ^^ unexpected type argument
error: aborting due to 4 previous errors
error: aborting due to 3 previous errors
Some errors have detailed explanations: E0107, E0308.
For more information about an error, try `rustc --explain E0107`.
For more information about this error, try `rustc --explain E0107`.