Don't classify NameRef paths inside attribute TokenTrees

This commit is contained in:
Lukas Wirth 2021-06-30 21:29:40 +02:00
parent 1b9b2d1f40
commit 04f1104179
3 changed files with 22 additions and 14 deletions

View file

@ -336,6 +336,14 @@ impl ast::Path {
pub fn qualifiers(&self) -> impl Iterator<Item = ast::Path> + Clone {
successors(self.qualifier(), |p| p.qualifier())
}
pub fn top_path(&self) -> ast::Path {
let mut this = self.clone();
while let Some(path) = this.parent_path() {
this = path;
}
this
}
}
impl ast::Use {