mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 07:04:49 +00:00
Add test for implicit format args support through nested macro call
This commit is contained in:
parent
fe0a85ca29
commit
4525787ed5
1 changed files with 25 additions and 0 deletions
|
@ -6673,3 +6673,28 @@ format_args!(r"{$0aaaaa}");
|
||||||
"#]],
|
"#]],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn format_args_implicit_nested() {
|
||||||
|
check(
|
||||||
|
r#"
|
||||||
|
//- minicore: fmt
|
||||||
|
macro_rules! foo {
|
||||||
|
($($tt:tt)*) => {
|
||||||
|
format_args!($($tt)*)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fn test() {
|
||||||
|
let aaaaa = "foo";
|
||||||
|
foo!(r"{$0aaaaa}");
|
||||||
|
}
|
||||||
|
"#,
|
||||||
|
expect![[r#"
|
||||||
|
*aaaaa*
|
||||||
|
|
||||||
|
```rust
|
||||||
|
let aaaaa: &str // size = 16 (0x10), align = 8, niches = 1
|
||||||
|
```
|
||||||
|
"#]],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue