1
Fork 0

Suggest fixing typos and let bindings at the same time

Fixes #132483
This commit is contained in:
uellenberg 2024-11-02 01:36:38 -07:00
parent 7c7bb7dc01
commit 67a85925b1
4 changed files with 52 additions and 4 deletions

View file

@ -894,10 +894,13 @@ impl<'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> {
// If the trait has a single item (which wasn't matched by the algorithm), suggest it
let suggestion = self.get_single_associated_item(path, &source, is_expected);
if !self.r.add_typo_suggestion(err, suggestion, ident_span) {
fallback = !self.let_binding_suggestion(err, ident_span);
}
self.r.add_typo_suggestion(err, suggestion, ident_span);
}
if self.let_binding_suggestion(err, ident_span) {
fallback = false;
}
fallback
}