Skip to content

Commit aa38be8

Browse files
authored
Merge pull request #18561 from markmurphydev/macro_name_raw_variable
Add macro expansion test for raw variable names
2 parents 8762a4f + a53ee64 commit aa38be8

File tree

1 file changed

+28
-0
lines changed
  • crates/hir-def/src/macro_expansion_tests/mbe

1 file changed

+28
-0
lines changed

crates/hir-def/src/macro_expansion_tests/mbe/matching.rs

+28
Original file line numberDiff line numberDiff line change
@@ -184,3 +184,31 @@ fn test() {
184184
"#]],
185185
);
186186
}
187+
188+
#[test]
189+
fn meta_variable_raw_name_equals_non_raw() {
190+
check(
191+
r#"
192+
macro_rules! m {
193+
($r#name:tt) => {
194+
$name
195+
}
196+
}
197+
198+
fn test() {
199+
m!(1234)
200+
}
201+
"#,
202+
expect![[r#"
203+
macro_rules! m {
204+
($r#name:tt) => {
205+
$name
206+
}
207+
}
208+
209+
fn test() {
210+
1234
211+
}
212+
"#]],
213+
);
214+
}

0 commit comments

Comments
 (0)