Suggest adding a type parameter for impls
This commit is contained in:
parent
24acc388da
commit
693e9579bc
4 changed files with 39 additions and 8 deletions
|
|
@ -5,7 +5,16 @@ LL | struct A<const N: u8>;
|
|||
| ---------------------- similarly named struct `A` defined here
|
||||
LL | trait Foo {}
|
||||
LL | impl Foo for A<N> {}
|
||||
| ^ help: a struct with a similar name exists: `A`
|
||||
| ^
|
||||
|
|
||||
help: a struct with a similar name exists
|
||||
|
|
||||
LL | impl Foo for A<A> {}
|
||||
| ^
|
||||
help: you might be missing a type parameter
|
||||
|
|
||||
LL | impl<N> Foo for A<N> {}
|
||||
| ^^^
|
||||
|
||||
error[E0412]: cannot find type `T` in this scope
|
||||
--> $DIR/diagnostics.rs:16:32
|
||||
|
|
@ -14,7 +23,16 @@ LL | struct A<const N: u8>;
|
|||
| ---------------------- similarly named struct `A` defined here
|
||||
...
|
||||
LL | impl<const N: u8> Foo for C<N, T> {}
|
||||
| ^ help: a struct with a similar name exists: `A`
|
||||
| ^
|
||||
|
|
||||
help: a struct with a similar name exists
|
||||
|
|
||||
LL | impl<const N: u8> Foo for C<N, A> {}
|
||||
| ^
|
||||
help: you might be missing a type parameter
|
||||
|
|
||||
LL | impl<const N, T: u8> Foo for C<N, T> {}
|
||||
| ^^^
|
||||
|
||||
error[E0747]: unresolved item provided when a constant was expected
|
||||
--> $DIR/diagnostics.rs:7:16
|
||||
|
|
|
|||
|
|
@ -2,7 +2,9 @@ error[E0412]: cannot find type `T` in this scope
|
|||
--> $DIR/issue-75627.rs:3:26
|
||||
|
|
||||
LL | unsafe impl Send for Foo<T> {}
|
||||
| ^ not found in this scope
|
||||
| - ^ not found in this scope
|
||||
| |
|
||||
| help: you might be missing a type parameter: `<T>`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -13,9 +13,18 @@ error[E0412]: cannot find type `U` in this scope
|
|||
--> $DIR/issue-78372.rs:3:31
|
||||
|
|
||||
LL | impl<T> DispatchFromDyn<Smaht<U, MISC>> for T {}
|
||||
| - ^ help: a type parameter with a similar name exists: `T`
|
||||
| - ^
|
||||
| |
|
||||
| similarly named type parameter `T` defined here
|
||||
|
|
||||
help: a type parameter with a similar name exists
|
||||
|
|
||||
LL | impl<T> DispatchFromDyn<Smaht<T, MISC>> for T {}
|
||||
| ^
|
||||
help: you might be missing a type parameter
|
||||
|
|
||||
LL | impl<T, U> DispatchFromDyn<Smaht<U, MISC>> for T {}
|
||||
| ^^^
|
||||
|
||||
error[E0412]: cannot find type `MISC` in this scope
|
||||
--> $DIR/issue-78372.rs:3:34
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue