Auto merge of #13742 - lowr:fix/assoc-type-shorthand-with-gats, r=flodiebold

fix: only shift `BoundVar`s that come from outside lowering context

Fixes #13734

There are some free functions `TyLoweringContext` methods call, which do not know anything about current binders in scope. We need to shift in the `BoundVar`s in substitutions that we get from them (#4952), but not those we get from `TyLoweringContext` methods.
This commit is contained in:
bors 2022-12-10 11:17:18 +00:00
commit 518e39bfe6
4 changed files with 46 additions and 21 deletions

View file

@ -1600,7 +1600,7 @@ impl<'a> SemanticsScope<'a> {
self.db,
def,
resolution.in_type_ns()?,
|name, _, id| cb(name, id.into()),
|name, id| cb(name, id.into()),
)
}
}

View file

@ -967,7 +967,7 @@ fn resolve_hir_path_(
db,
def,
res.in_type_ns()?,
|name, _, id| (name == unresolved.name).then(|| id),
|name, id| (name == unresolved.name).then(|| id),
)
})
.map(TypeAlias::from)