Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide/src/expand_macro.rs')
-rw-r--r--crates/ide/src/expand_macro.rs20
1 files changed, 19 insertions, 1 deletions
diff --git a/crates/ide/src/expand_macro.rs b/crates/ide/src/expand_macro.rs
index 77668973ea..cf81e2de00 100644
--- a/crates/ide/src/expand_macro.rs
+++ b/crates/ide/src/expand_macro.rs
@@ -550,7 +550,7 @@ macro_rules! foo {
}
fn main() {
- let res = fo$0o!();
+ fo$0o!()
}
"#,
expect![[r#"
@@ -560,6 +560,24 @@ fn main() {
}
#[test]
+ fn macro_expand_item_expansion_in_expression_call() {
+ check(
+ r#"
+macro_rules! foo {
+ () => {fn f<T>() {}};
+}
+
+fn main() {
+ let res = fo$0o!();
+}
+"#,
+ expect![[r#"
+ foo!
+ fn f<T>(){}"#]],
+ );
+ }
+
+ #[test]
fn macro_expand_derive() {
check(
r#"