about summary refs log tree commit diff
path: root/compiler/rustc_resolve/src
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2023-09-23 01:54:05 +0000
committerEsteban Küber <esteban@kuber.com.ar>2023-09-23 01:54:05 +0000
commitac5e18756a4f0987c5861e45b82ac6f410fd4734 (patch)
tree20ac64cd25c48a33fe23c7ee0a35559d380dca8e /compiler/rustc_resolve/src
parent0e986825762edd031bc6bf4a78d9162ac2ed6268 (diff)
downloadrust-ac5e18756a4f0987c5861e45b82ac6f410fd4734.tar.gz
rust-ac5e18756a4f0987c5861e45b82ac6f410fd4734.zip
Tweak wording and logic
Diffstat (limited to 'compiler/rustc_resolve/src')
-rw-r--r--compiler/rustc_resolve/src/late/diagnostics.rs15
1 files changed, 10 insertions, 5 deletions
diff --git a/compiler/rustc_resolve/src/late/diagnostics.rs b/compiler/rustc_resolve/src/late/diagnostics.rs
index c690ac6c043..06a08f29a1e 100644
--- a/compiler/rustc_resolve/src/late/diagnostics.rs
+++ b/compiler/rustc_resolve/src/late/diagnostics.rs
@@ -243,15 +243,20 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
                             ));
                             None
                         }
-                        AssocItemKind::Fn(fn_) => Some((
+                        AssocItemKind::Fn(fn_) if fn_.sig.decl.has_self() => Some((
                             sp,
-                            "consider using the associated function",
-                            if fn_.sig.decl.has_self() { "self." } else { "Self::" },
+                            "consider using the method on `Self`",
+                            "self.".to_string(),
+                        )),
+                        AssocItemKind::Fn(_) => Some((
+                            sp,
+                            "consider using the associated function on `Self`",
+                            "Self::".to_string(),
                         )),
                         AssocItemKind::Const(..) => Some((
                             sp,
-                            "consider using the associated constant",
-                            "Self::",
+                            "consider using the associated constant on `Self`",
+                            "Self::".to_string(),
                         )),
                         _ => None
                     }