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.rs11
1 files changed, 9 insertions, 2 deletions
diff --git a/crates/hir-expand/src/name.rs b/crates/hir-expand/src/name.rs
index 67e73f7fc2..fce9df6722 100644
--- a/crates/hir-expand/src/name.rs
+++ b/crates/hir-expand/src/name.rs
@@ -82,9 +82,16 @@ impl Name {
Name { symbol: Symbol::intern(text), ctx: () }
}
- pub fn new(text: &str, ctx: SyntaxContextId) -> Name {
+ pub fn new(text: &str, raw: tt::IdentIsRaw, ctx: SyntaxContextId) -> Name {
_ = ctx;
- Name { symbol: Symbol::intern(text), ctx: () }
+ Name {
+ symbol: if raw.yes() {
+ Symbol::intern(&format_smolstr!("{}{text}", raw.as_str()))
+ } else {
+ Symbol::intern(text)
+ },
+ ctx: (),
+ }
}
pub fn new_tuple_field(idx: usize) -> Name {