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 | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/crates/hir_expand/src/mod_path.rs b/crates/hir_expand/src/mod_path.rs index 9c06a3f892..d1f0b7a87e 100644 --- a/crates/hir_expand/src/mod_path.rs +++ b/crates/hir_expand/src/mod_path.rs @@ -5,7 +5,11 @@ use std::{ iter, }; -use crate::{db::AstDatabase, hygiene::Hygiene, name::Name}; +use crate::{ + db::AstDatabase, + hygiene::Hygiene, + name::{known, Name}, +}; use base_db::CrateId; use either::Either; use syntax::{ast, AstNode}; @@ -162,6 +166,15 @@ 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 + } ast::PathSegmentKind::CrateKw => { if prefix.is_some() { return None; |