aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def/src/path
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-12-17 14:39:07 +0000
committerGitHub <[email protected]>2019-12-17 14:39:07 +0000
commitb90f9e6d594584ab003a33142bb2193aea6f8bcd (patch)
tree05d3cf8ec0fcca490ffbac1534d3a08c2eeb854c /crates/ra_hir_def/src/path
parentf51a3fed9f8227a2b3bc8521b529cb9734ff0e7e (diff)
parentaca022f1d49a6d945f3ef4f8c781d7337120b68d (diff)
Merge #2581
2581: Refactor PathKind r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir_def/src/path')
-rw-r--r--crates/ra_hir_def/src/path/lower.rs4
-rw-r--r--crates/ra_hir_def/src/path/lower/lower_use.rs4
2 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_hir_def/src/path/lower.rs b/crates/ra_hir_def/src/path/lower.rs
index a2e995198..c71b52d89 100644
--- a/crates/ra_hir_def/src/path/lower.rs
+++ b/crates/ra_hir_def/src/path/lower.rs
@@ -95,11 +95,11 @@ pub(super) fn lower_path(mut path: ast::Path, hygiene: &Hygiene) -> Option<Path>
95 break; 95 break;
96 } 96 }
97 ast::PathSegmentKind::SelfKw => { 97 ast::PathSegmentKind::SelfKw => {
98 kind = PathKind::Self_; 98 kind = PathKind::Super(0);
99 break; 99 break;
100 } 100 }
101 ast::PathSegmentKind::SuperKw => { 101 ast::PathSegmentKind::SuperKw => {
102 kind = PathKind::Super; 102 kind = PathKind::Super(1);
103 break; 103 break;
104 } 104 }
105 } 105 }
diff --git a/crates/ra_hir_def/src/path/lower/lower_use.rs b/crates/ra_hir_def/src/path/lower/lower_use.rs
index ea3fdb56c..062c02063 100644
--- a/crates/ra_hir_def/src/path/lower/lower_use.rs
+++ b/crates/ra_hir_def/src/path/lower/lower_use.rs
@@ -95,13 +95,13 @@ fn convert_path(prefix: Option<ModPath>, path: ast::Path, hygiene: &Hygiene) ->
95 if prefix.is_some() { 95 if prefix.is_some() {
96 return None; 96 return None;
97 } 97 }
98 ModPath::from_simple_segments(PathKind::Self_, iter::empty()) 98 ModPath::from_simple_segments(PathKind::Super(0), iter::empty())
99 } 99 }
100 ast::PathSegmentKind::SuperKw => { 100 ast::PathSegmentKind::SuperKw => {
101 if prefix.is_some() { 101 if prefix.is_some() {
102 return None; 102 return None;
103 } 103 }
104 ModPath::from_simple_segments(PathKind::Super, iter::empty()) 104 ModPath::from_simple_segments(PathKind::Super(1), iter::empty())
105 } 105 }
106 ast::PathSegmentKind::Type { .. } => { 106 ast::PathSegmentKind::Type { .. } => {
107 // not allowed in imports 107 // not allowed in imports