Improve diagnostics for inaccessible items

This commit is contained in:
Fabian Wolff 2021-09-18 00:07:41 +02:00
parent 65eb381dec
commit 750018e16e
10 changed files with 164 additions and 56 deletions

View file

@ -2966,7 +2966,15 @@ impl<'a> Resolver<'a> {
(None, false)
};
if !candidates.is_empty() {
diagnostics::show_candidates(&mut err, span, &candidates, instead, found_use);
diagnostics::show_candidates(
&self.definitions,
self.session,
&mut err,
span,
&candidates,
instead,
found_use,
);
} else if let Some((span, msg, sugg, appl)) = suggestion {
err.span_suggestion(span, msg, sugg, appl);
}