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

@ -2,9 +2,7 @@ error[E0107]: function takes 1 generic argument but 2 generic arguments were sup
--> $DIR/explicit-generic-args-for-impl.rs:4:5
|
LL | foo::<str, String>("".to_string());
| ^^^ ------ help: remove this generic argument
| |
| expected 1 generic argument
| ^^^ expected 1 generic argument
|
note: function defined here, with 1 generic parameter: `T`
--> $DIR/explicit-generic-args-for-impl.rs:1:4
@ -12,6 +10,11 @@ note: function defined here, with 1 generic parameter: `T`
LL | fn foo<T: ?Sized>(_f: impl AsRef<T>) {}
| ^^^ -
= note: `impl Trait` cannot be explicitly specified as a generic argument
help: remove this generic argument
|
LL - foo::<str, String>("".to_string());
LL + foo::<str, >("".to_string());
|
error: aborting due to 1 previous error