Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir_expand/src/mod_path.rs')
| -rw-r--r-- | crates/hir_expand/src/mod_path.rs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/crates/hir_expand/src/mod_path.rs b/crates/hir_expand/src/mod_path.rs index d1f0b7a87e..5e264d0398 100644 --- a/crates/hir_expand/src/mod_path.rs +++ b/crates/hir_expand/src/mod_path.rs @@ -167,13 +167,10 @@ fn convert_path( } } ast::PathSegmentKind::SelfTypeKw => { - let mut res = prefix.unwrap_or_else(|| { - ModPath::from_kind( - segment.coloncolon_token().map_or(PathKind::Plain, |_| PathKind::Abs), - ) - }); - res.segments.push(known::SELF_TYPE); - res + if prefix.is_some() { + return None; + } + ModPath::from_segments(PathKind::Plain, Some(known::SELF_TYPE)) } ast::PathSegmentKind::CrateKw => { if prefix.is_some() { |