From cb863390f23bc2eac6561d55def9bd3ba54605fc Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Fri, 15 Jan 2021 18:57:32 +0100 Subject: Handle self/super/crate in PathSegment as NameRef --- crates/hir_def/src/resolver.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/hir_def/src') diff --git a/crates/hir_def/src/resolver.rs b/crates/hir_def/src/resolver.rs index 61059c349..85ddc2c47 100644 --- a/crates/hir_def/src/resolver.rs +++ b/crates/hir_def/src/resolver.rs @@ -258,7 +258,7 @@ impl Resolver { ) -> Option { let n_segments = path.segments.len(); let tmp = name![self]; - let first_name = if path.is_self() { &tmp } else { &path.segments.first()? }; + let first_name = if path.is_self() { &tmp } else { path.segments.first()? }; let skip_to_mod = path.kind != PathKind::Plain && !path.is_self(); for scope in self.scopes.iter().rev() { match scope { -- cgit v1.2.3