Closed
Description
I tried this code:
fn example<T: FromStr<Err = impl Debug>>() {
todo!();
}
fn main() {
example::<usize>();
}
I expected this to compile, however I received this error instead:
error[E0632]: cannot provide explicit generic arguments when `impl Trait` is used in argument position
--> x.rs:9:15
|
9 | example::<usize>();
| ^^^^^ explicit generic argument not allowed
This error is unexpected, because impl Debug
is not used in the argument position and is instead part of a trait bound on a named type parameter.
Meta
rustc --version --verbose
:
rustc 1.49.0-nightly (cf9cf7c92 2020-11-10)
binary: rustc
commit-hash: cf9cf7c923eb01146971429044f216a3ca905e06
commit-date: 2020-11-10
host: x86_64-unknown-linux-gnu
release: 1.49.0-nightly