Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/infer/closure.rs')
-rw-r--r--crates/hir-ty/src/infer/closure.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/crates/hir-ty/src/infer/closure.rs b/crates/hir-ty/src/infer/closure.rs
index 91ba2af85e..6fc82f6743 100644
--- a/crates/hir-ty/src/infer/closure.rs
+++ b/crates/hir-ty/src/infer/closure.rs
@@ -514,8 +514,11 @@ impl InferenceContext<'_> {
if path.type_anchor().is_some() {
return None;
}
- let result = self.resolver.resolve_path_in_value_ns_fully(self.db.upcast(), path).and_then(
- |result| match result {
+ let hygiene = self.body.expr_or_pat_path_hygiene(id);
+ let result = self
+ .resolver
+ .resolve_path_in_value_ns_fully(self.db.upcast(), path, hygiene)
+ .and_then(|result| match result {
ValueNs::LocalBinding(binding) => {
let mir_span = match id {
ExprOrPatId::ExprId(id) => MirSpan::ExprId(id),
@@ -525,8 +528,7 @@ impl InferenceContext<'_> {
Some(HirPlace { local: binding, projections: Vec::new() })
}
_ => None,
- },
- );
+ });
result
}