Don't suggest dyn as parameter to add

This commit is contained in:
Michael Goulet 2023-01-08 23:27:22 +00:00
parent 950b47fb96
commit bf0623e363
4 changed files with 11 additions and 24 deletions

View File

@ -2065,7 +2065,11 @@ impl<'a: 'ast, 'ast> LateResolutionVisitor<'a, '_, 'ast> {
path: &[Segment],
) -> Option<(Span, &'static str, String, Applicability)> {
let (ident, span) = match path {
[segment] if !segment.has_generic_args && segment.ident.name != kw::SelfUpper => {
[segment]
if !segment.has_generic_args
&& segment.ident.name != kw::SelfUpper
&& segment.ident.name != kw::Dyn =>
{
(segment.ident.to_string(), segment.ident.span)
}
_ => return None,

View File

@ -17,9 +17,12 @@ error[E0412]: cannot find type `VAL` in this scope
--> $DIR/ice-6252.rs:10:63
|
LL | impl<N, M> TypeVal<usize> for Multiply<N, M> where N: TypeVal<VAL> {}
| - ^^^ not found in this scope
| |
| help: you might be missing a type parameter: `, VAL`
| ^^^ not found in this scope
|
help: you might be missing a type parameter
|
LL | impl<N, M, VAL> TypeVal<usize> for Multiply<N, M> where N: TypeVal<VAL> {}
| +++++
error[E0046]: not all trait items implemented, missing: `VAL`
--> $DIR/ice-6252.rs:10:1

View File

@ -11,11 +11,6 @@ error[E0412]: cannot find type `dyn` in this scope
|
LL | eq::<dyn, Foo>
| ^^^ not found in this scope
|
help: you might be missing a type parameter
|
LL | fn eq<A, B, dyn>() {
| +++++
warning: trait objects without an explicit `dyn` are deprecated
--> $DIR/issue-86756.rs:5:15

View File

@ -27,22 +27,12 @@ error[E0412]: cannot find type `dyn` in this scope
|
LL | type A2 = dyn<dyn, dyn>;
| ^^^ not found in this scope
|
help: you might be missing a type parameter
|
LL | type A2<dyn> = dyn<dyn, dyn>;
| +++++
error[E0412]: cannot find type `dyn` in this scope
--> $DIR/dyn-trait-compatibility.rs:5:20
|
LL | type A2 = dyn<dyn, dyn>;
| ^^^ not found in this scope
|
help: you might be missing a type parameter
|
LL | type A2<dyn> = dyn<dyn, dyn>;
| +++++
error[E0412]: cannot find type `dyn` in this scope
--> $DIR/dyn-trait-compatibility.rs:9:11
@ -55,11 +45,6 @@ error[E0412]: cannot find type `dyn` in this scope
|
LL | type A3 = dyn<<dyn as dyn>::dyn>;
| ^^^ not found in this scope
|
help: you might be missing a type parameter
|
LL | type A3<dyn> = dyn<<dyn as dyn>::dyn>;
| +++++
error: aborting due to 8 previous errors