Skip to content

Commit 71926a2

Browse files
committed
Add tests from #10134
1 parent e423a0a commit 71926a2

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/ui/crashes/possible_borrower.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// https://github.com/rust-lang/rust-clippy/issues/10134
2+
3+
fn meow(_s: impl AsRef<str>) {}
4+
5+
macro_rules! quad {
6+
($x:stmt) => {
7+
$x
8+
$x
9+
$x
10+
$x
11+
};
12+
}
13+
14+
fn main() {
15+
let i = 0;
16+
quad!(quad!(quad!(quad!(quad!(meow(format!("abc{i}")))))));
17+
}
18+
19+
// https://github.com/rust-lang/rust-clippy/issues/10134#issuecomment-1374480660
20+
fn second_testcase() {
21+
quad!(quad!(quad!(for i in 0..4 {
22+
quad!(quad!(meow(format!("abc{i}"))));
23+
})));
24+
}

0 commit comments

Comments
 (0)