mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
Diagnose unresolved self value in path expression
This commit is contained in:
parent
f2afcb874e
commit
4420e7148f
2 changed files with 18 additions and 1 deletions
|
@ -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,
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue