Missing "impl Trait
introduces an implicit type parameter" when the trait comes from another crate
#69944
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
When a trait has a method that has type parameters (
fn foo<T>()
) and implicit type parameters (fn foo(x: impl Clone)
), if you impl the trait, the compiler gives the error:This is fine but if the trait comes from another crate, the compiler will just say:
Here is a repository with this sample code: https://github.com/cecton/rust-type-param-error
I expected to see this happen: it would be great to see that there are implicit type parameters even if it comes from another crate or at least a warning.
Instead, this happened: I see that there should be 3 type parameters and I provided 2 but if I look at the code I see 2 type parameters, not 3. It was not obvious to me that the impl in parameter was introducing a type parameter.
Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: