Suggest imports of unresolved macros
This commit is contained in:
parent
6ac6c67574
commit
13dfbb64d3
1 changed files with 4 additions and 0 deletions
|
@ -929,6 +929,10 @@ impl<'a> Resolver<'a> {
|
|||
);
|
||||
self.add_typo_suggestion(err, suggestion, ident.span);
|
||||
|
||||
let import_suggestions =
|
||||
self.lookup_import_candidates(ident, Namespace::MacroNS, parent_scope, |_| true);
|
||||
show_candidates(err, None, &import_suggestions, false, true);
|
||||
|
||||
if macro_kind == MacroKind::Derive && (ident.name == sym::Send || ident.name == sym::Sync) {
|
||||
let msg = format!("unsafe traits like `{}` should be implemented explicitly", ident);
|
||||
err.span_note(ident.span, &msg);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue