Skip to content

Commit 4525787

Browse files
committed
Add test for implicit format args support through nested macro call
1 parent fe0a85c commit 4525787

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

crates/ide/src/hover/tests.rs

+25
Original file line numberDiff line numberDiff line change
@@ -6673,3 +6673,28 @@ format_args!(r"{$0aaaaa}");
66736673
"#]],
66746674
);
66756675
}
6676+
6677+
#[test]
6678+
fn format_args_implicit_nested() {
6679+
check(
6680+
r#"
6681+
//- minicore: fmt
6682+
macro_rules! foo {
6683+
($($tt:tt)*) => {
6684+
format_args!($($tt)*)
6685+
}
6686+
}
6687+
fn test() {
6688+
let aaaaa = "foo";
6689+
foo!(r"{$0aaaaa}");
6690+
}
6691+
"#,
6692+
expect![[r#"
6693+
*aaaaa*
6694+
6695+
```rust
6696+
let aaaaa: &str // size = 16 (0x10), align = 8, niches = 1
6697+
```
6698+
"#]],
6699+
);
6700+
}

0 commit comments

Comments
 (0)