about summary refs log tree commit diff
path: root/compiler/rustc_resolve/src
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2023-01-08 23:27:22 +0000
committerMichael Goulet <michael@errs.io>2023-01-12 22:04:30 +0000
commitbf0623e3633a371374341265c8729f6255bfde4c (patch)
treecd02094e911a36558ad61ea1b5ff1e7fb25ad1fb /compiler/rustc_resolve/src
parent950b47fb967ac8db2ad67da87fb167bf88963bbf (diff)
downloadrust-bf0623e3633a371374341265c8729f6255bfde4c.tar.gz
rust-bf0623e3633a371374341265c8729f6255bfde4c.zip
Don't suggest dyn as parameter to add
Diffstat (limited to 'compiler/rustc_resolve/src')
-rw-r--r--compiler/rustc_resolve/src/late/diagnostics.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/rustc_resolve/src/late/diagnostics.rs b/compiler/rustc_resolve/src/late/diagnostics.rs
index d92f5a7c05e..d92b046d0b9 100644
--- a/compiler/rustc_resolve/src/late/diagnostics.rs
+++ b/compiler/rustc_resolve/src/late/diagnostics.rs
@@ -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,