From 69faf81e0db5abe54b97708c5b8089934fca32f6 Mon Sep 17 00:00:00 2001 From: Josh Mcguigan Date: Sat, 29 Feb 2020 19:48:55 -0800 Subject: fix #2377 super::super::* --- crates/ra_hir_def/src/path/lower/lower_use.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'crates/ra_hir_def/src/path/lower') 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 b6d1125e2..278d5196e 100644 --- a/crates/ra_hir_def/src/path/lower/lower_use.rs +++ b/crates/ra_hir_def/src/path/lower/lower_use.rs @@ -103,10 +103,13 @@ fn convert_path(prefix: Option, path: ast::Path, hygiene: &Hygiene) -> ModPath::from_segments(PathKind::Super(0), iter::empty()) } ast::PathSegmentKind::SuperKw => { - if prefix.is_some() { - return None; - } - ModPath::from_segments(PathKind::Super(1), iter::empty()) + let nested_super_count = match prefix.map(|p| p.kind) { + Some(PathKind::Super(n)) => n, + Some(_) => return None, + None => 0, + }; + + ModPath::from_segments(PathKind::Super(nested_super_count + 1), iter::empty()) } ast::PathSegmentKind::Type { .. } => { // not allowed in imports -- cgit v1.2.3