resolve: Use NameBinding for local variables and generic parameters

This commit is contained in:
Vadim Petrochenkov
2021-09-18 23:41:41 +03:00
parent 5e02151318
commit c1e8fc8c97
3 changed files with 147 additions and 215 deletions

View File

@@ -1294,7 +1294,8 @@ impl<'a: 'ast, 'ast> LateResolutionVisitor<'a, '_, 'ast> {
// Walk backwards up the ribs in scope and collect candidates.
for rib in self.ribs[ns].iter().rev() {
// Locals and type parameters
for (ident, &res) in &rib.bindings {
for (ident, binding) in &rib.bindings {
let res = binding.res();
if filter_fn(res) {
names.push(TypoSuggestion::typo_from_res(ident.name, res));
}