diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-01-15 18:40:47 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-01-15 18:40:47 +0000 |
commit | 8a869e870ac6328967fb120a0ebe44a9c900eaf0 (patch) | |
tree | f4ad40fc09483af3e9fea77d4b4156130539a70c /crates/hir_def/src | |
parent | 148e3d0f6a28f57565538dca7d9c0f5f726a5908 (diff) | |
parent | cb863390f23bc2eac6561d55def9bd3ba54605fc (diff) |
Merge #7288
7288: Handle self/super/crate in PathSegment as NameRef r=matklad a=Veykril
Wrapping self/super/crate in NameRef as per https://github.com/rust-analyzer/rust-analyzer/pull/7261#issuecomment-760023172
Co-authored-by: Lukas Wirth <[email protected]>
Diffstat (limited to 'crates/hir_def/src')
-rw-r--r-- | crates/hir_def/src/resolver.rs | 2 |
1 files changed, 1 insertions, 1 deletions
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 { | |||
258 | ) -> Option<ResolveValueResult> { | 258 | ) -> Option<ResolveValueResult> { |
259 | let n_segments = path.segments.len(); | 259 | let n_segments = path.segments.len(); |
260 | let tmp = name![self]; | 260 | let tmp = name![self]; |
261 | let first_name = if path.is_self() { &tmp } else { &path.segments.first()? }; | 261 | let first_name = if path.is_self() { &tmp } else { path.segments.first()? }; |
262 | let skip_to_mod = path.kind != PathKind::Plain && !path.is_self(); | 262 | let skip_to_mod = path.kind != PathKind::Plain && !path.is_self(); |
263 | for scope in self.scopes.iter().rev() { | 263 | for scope in self.scopes.iter().rev() { |
264 | match scope { | 264 | match scope { |