2023-02-23 17:27:06 +00:00
|
|
|
error[E0107]: function takes 1 generic argument but 2 generic arguments were supplied
|
2022-05-09 14:14:43 +00:00
|
|
|
--> $DIR/explicit-generic-args-for-impl.rs:4:5
|
2021-06-09 19:56:41 +00:00
|
|
|
|
|
|
|
|
LL | foo::<str, String>("".to_string());
|
2024-07-05 01:08:44 +00:00
|
|
|
| ^^^ expected 1 generic argument
|
2021-06-09 19:56:41 +00:00
|
|
|
|
|
2021-08-03 12:04:50 +00:00
|
|
|
note: function defined here, with 1 generic parameter: `T`
|
2022-05-09 14:14:43 +00:00
|
|
|
--> $DIR/explicit-generic-args-for-impl.rs:1:4
|
2021-06-09 19:56:41 +00:00
|
|
|
|
|
|
|
|
LL | fn foo<T: ?Sized>(_f: impl AsRef<T>) {}
|
|
|
|
| ^^^ -
|
2022-02-14 03:27:33 +00:00
|
|
|
= note: `impl Trait` cannot be explicitly specified as a generic argument
|
2024-07-05 01:28:24 +00:00
|
|
|
help: remove the unnecessary generic argument
|
2024-07-05 01:08:44 +00:00
|
|
|
|
|
|
|
|
LL - foo::<str, String>("".to_string());
|
2024-07-05 17:24:23 +00:00
|
|
|
LL + foo::<str>("".to_string());
|
2024-07-05 01:08:44 +00:00
|
|
|
|
|
2021-06-09 19:56:41 +00:00
|
|
|
|
2023-11-21 15:44:16 +00:00
|
|
|
error: aborting due to 1 previous error
|
2021-06-09 19:56:41 +00:00
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0107`.
|