Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/infer/expr.rs')
-rw-r--r--crates/hir-ty/src/infer/expr.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/crates/hir-ty/src/infer/expr.rs b/crates/hir-ty/src/infer/expr.rs
index 3647243537..7a0f7872a6 100644
--- a/crates/hir-ty/src/infer/expr.rs
+++ b/crates/hir-ty/src/infer/expr.rs
@@ -440,7 +440,8 @@ impl InferenceContext<'_> {
let ty = match self.infer_path(p, tgt_expr.into()) {
Some(ty) => ty,
None => {
- if matches!(p, Path::Normal { mod_path, .. } if mod_path.is_ident()) {
+ if matches!(p, Path::Normal { mod_path, .. } if mod_path.is_ident() || mod_path.is_self())
+ {
self.push_diagnostic(InferenceDiagnostic::UnresolvedIdent {
expr: tgt_expr,
});