Suggest importing the right kind of macro.

This commit is contained in:
Mara Bos 2021-08-22 14:06:45 +02:00
parent e7f7fe462a
commit bcc5ecb969
4 changed files with 53 additions and 3 deletions

View file

@ -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) {