1
Fork 0

Use verbose suggestion for "wrong # of generics"

This commit is contained in:
Esteban Küber 2024-07-05 01:08:44 +00:00
parent 2a1c384f0e
commit c807ac0340
52 changed files with 811 additions and 401 deletions

View file

@ -18,15 +18,18 @@ error[E0107]: associated type takes 0 generic arguments but 1 generic argument w
--> $DIR/invalid_const_in_lifetime_position.rs:4:26
|
LL | fn f<'a>(arg : Box<dyn X<Y<1> = &'a ()>>) {}
| ^--- help: remove these generics
| |
| expected 0 generic arguments
| ^ expected 0 generic arguments
|
note: associated type defined here, with 0 generic parameters
--> $DIR/invalid_const_in_lifetime_position.rs:2:10
|
LL | type Y<'a>;
| ^
help: remove these generics
|
LL - fn f<'a>(arg : Box<dyn X<Y<1> = &'a ()>>) {}
LL + fn f<'a>(arg : Box<dyn X<Y = &'a ()>>) {}
|
error[E0107]: associated type takes 1 lifetime argument but 0 lifetime arguments were supplied
--> $DIR/invalid_const_in_lifetime_position.rs:4:26
@ -49,9 +52,7 @@ error[E0107]: associated type takes 0 generic arguments but 1 generic argument w
--> $DIR/invalid_const_in_lifetime_position.rs:4:26
|
LL | fn f<'a>(arg : Box<dyn X<Y<1> = &'a ()>>) {}
| ^--- help: remove these generics
| |
| expected 0 generic arguments
| ^ expected 0 generic arguments
|
note: associated type defined here, with 0 generic parameters
--> $DIR/invalid_const_in_lifetime_position.rs:2:10
@ -59,6 +60,11 @@ note: associated type defined here, with 0 generic parameters
LL | type Y<'a>;
| ^
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
help: remove these generics
|
LL - fn f<'a>(arg : Box<dyn X<Y<1> = &'a ()>>) {}
LL + fn f<'a>(arg : Box<dyn X<Y = &'a ()>>) {}
|
error[E0107]: associated type takes 1 lifetime argument but 0 lifetime arguments were supplied
--> $DIR/invalid_const_in_lifetime_position.rs:4:26
@ -81,9 +87,7 @@ error[E0107]: associated type takes 0 generic arguments but 1 generic argument w
--> $DIR/invalid_const_in_lifetime_position.rs:4:26
|
LL | fn f<'a>(arg : Box<dyn X<Y<1> = &'a ()>>) {}
| ^--- help: remove these generics
| |
| expected 0 generic arguments
| ^ expected 0 generic arguments
|
note: associated type defined here, with 0 generic parameters
--> $DIR/invalid_const_in_lifetime_position.rs:2:10
@ -91,6 +95,11 @@ note: associated type defined here, with 0 generic parameters
LL | type Y<'a>;
| ^
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
help: remove these generics
|
LL - fn f<'a>(arg : Box<dyn X<Y<1> = &'a ()>>) {}
LL + fn f<'a>(arg : Box<dyn X<Y = &'a ()>>) {}
|
error[E0038]: the trait `X` cannot be made into an object
--> $DIR/invalid_const_in_lifetime_position.rs:4:20

View file

@ -2,15 +2,18 @@ error[E0107]: type alias takes 1 lifetime argument but 2 lifetime arguments were
--> $DIR/mismatched_arg_count.rs:7:29
|
LL | fn bar<'a, T: Trait<'a>>(_: Alias<'a, 'a, T>) {}
| ^^^^^ -- help: remove this lifetime argument
| |
| expected 1 lifetime argument
| ^^^^^ expected 1 lifetime argument
|
note: type alias defined here, with 1 lifetime parameter: `'a`
--> $DIR/mismatched_arg_count.rs:5:6
|
LL | type Alias<'a, T> = <T as Trait<'a>>::Assoc;
| ^^^^^ --
help: remove this lifetime argument
|
LL - fn bar<'a, T: Trait<'a>>(_: Alias<'a, 'a, T>) {}
LL + fn bar<'a, T: Trait<'a>>(_: Alias<'a, , T>) {}
|
error: aborting due to 1 previous error