about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2021-08-22 20:52:55 +0200
committerGitHub <noreply@github.com>2021-08-22 20:52:55 +0200
commit518b27b57ae2ce9e3a10f167c36385b1dbbbf614 (patch)
tree59350f79900e3785875ace9b84f97dd4c9feb3bd /compiler
parent167ae26a889649fd6d6499eaeef3e7acd5c9c5df (diff)
parentbcc5ecb969579eb1c5fd4df0f7855105b66fe907 (diff)
downloadrust-518b27b57ae2ce9e3a10f167c36385b1dbbbf614.tar.gz
rust-518b27b57ae2ce9e3a10f167c36385b1dbbbf614.zip
Rollup merge of #88229 - m-ou-se:macro-suggest-right-kind, r=estebank
Suggest importing the right kind of macro.

Fixes #88228.

r? `@estebank`
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_resolve/src/diagnostics.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/compiler/rustc_resolve/src/diagnostics.rs b/compiler/rustc_resolve/src/diagnostics.rs
index 0a5da653fab..3cf04268756 100644
--- a/compiler/rustc_resolve/src/diagnostics.rs
+++ b/compiler/rustc_resolve/src/diagnostics.rs
@@ -950,9 +950,7 @@ impl<'a> Resolver<'a> {
         self.add_typo_suggestion(err, suggestion, ident.span);
 
         let import_suggestions =
-            self.lookup_import_candidates(ident, Namespace::MacroNS, parent_scope, |res| {
-                matches!(res, Res::Def(DefKind::Macro(MacroKind::Bang), _))
-            });
+            self.lookup_import_candidates(ident, Namespace::MacroNS, parent_scope, is_expected);
         show_candidates(err, None, &import_suggestions, false, true);
 
         if macro_kind == MacroKind::Derive && (ident.name == sym::Send || ident.name == sym::Sync) {