mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-21 11:23:03 +00:00
Don't suggest dyn as parameter to add
This commit is contained in:
parent
950b47fb96
commit
bf0623e363
@ -2065,7 +2065,11 @@ impl<'a: 'ast, 'ast> LateResolutionVisitor<'a, '_, 'ast> {
|
|||||||
path: &[Segment],
|
path: &[Segment],
|
||||||
) -> Option<(Span, &'static str, String, Applicability)> {
|
) -> Option<(Span, &'static str, String, Applicability)> {
|
||||||
let (ident, span) = match path {
|
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)
|
(segment.ident.to_string(), segment.ident.span)
|
||||||
}
|
}
|
||||||
_ => return None,
|
_ => return None,
|
||||||
|
@ -17,9 +17,12 @@ error[E0412]: cannot find type `VAL` in this scope
|
|||||||
--> $DIR/ice-6252.rs:10:63
|
--> $DIR/ice-6252.rs:10:63
|
||||||
|
|
|
|
||||||
LL | impl<N, M> TypeVal<usize> for Multiply<N, M> where N: TypeVal<VAL> {}
|
LL | impl<N, M> TypeVal<usize> for Multiply<N, M> where N: TypeVal<VAL> {}
|
||||||
| - ^^^ not found in this scope
|
| ^^^ not found in this scope
|
||||||
| |
|
|
|
||||||
| help: you might be missing a type parameter: `, VAL`
|
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`
|
error[E0046]: not all trait items implemented, missing: `VAL`
|
||||||
--> $DIR/ice-6252.rs:10:1
|
--> $DIR/ice-6252.rs:10:1
|
||||||
|
@ -11,11 +11,6 @@ error[E0412]: cannot find type `dyn` in this scope
|
|||||||
|
|
|
|
||||||
LL | eq::<dyn, Foo>
|
LL | eq::<dyn, Foo>
|
||||||
| ^^^ not found in this scope
|
| ^^^ 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
|
warning: trait objects without an explicit `dyn` are deprecated
|
||||||
--> $DIR/issue-86756.rs:5:15
|
--> $DIR/issue-86756.rs:5:15
|
||||||
|
@ -27,22 +27,12 @@ error[E0412]: cannot find type `dyn` in this scope
|
|||||||
|
|
|
|
||||||
LL | type A2 = dyn<dyn, dyn>;
|
LL | type A2 = dyn<dyn, dyn>;
|
||||||
| ^^^ not found in this scope
|
| ^^^ 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
|
error[E0412]: cannot find type `dyn` in this scope
|
||||||
--> $DIR/dyn-trait-compatibility.rs:5:20
|
--> $DIR/dyn-trait-compatibility.rs:5:20
|
||||||
|
|
|
|
||||||
LL | type A2 = dyn<dyn, dyn>;
|
LL | type A2 = dyn<dyn, dyn>;
|
||||||
| ^^^ not found in this scope
|
| ^^^ 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
|
error[E0412]: cannot find type `dyn` in this scope
|
||||||
--> $DIR/dyn-trait-compatibility.rs:9:11
|
--> $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>;
|
LL | type A3 = dyn<<dyn as dyn>::dyn>;
|
||||||
| ^^^ not found in this scope
|
| ^^^ 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
|
error: aborting due to 8 previous errors
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user