Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-expand/src/name.rs')
-rw-r--r--crates/hir-expand/src/name.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/crates/hir-expand/src/name.rs b/crates/hir-expand/src/name.rs
index 217d991d11..0408a6943d 100644
--- a/crates/hir-expand/src/name.rs
+++ b/crates/hir-expand/src/name.rs
@@ -197,6 +197,10 @@ impl Name {
pub fn symbol(&self) -> &Symbol {
&self.symbol
}
+
+ pub fn is_generated(&self) -> bool {
+ self.as_str().starts_with("<ra@gennew>")
+ }
}
struct Display<'a> {
@@ -254,7 +258,7 @@ impl AsName for ast::NameOrNameRef {
}
}
-impl<Span> AsName for tt::Ident<Span> {
+impl AsName for tt::Ident {
fn as_name(&self) -> Name {
Name::new_root(self.sym.as_str())
}