]> git.proxmox.com Git - rustc.git/blame - src/test/ui/issues/issue-65131.rs
New upstream version 1.60.0+dfsg1
[rustc.git] / src / test / ui / issues / issue-65131.rs
CommitLineData
ba9703b0
XL
1fn get_pair(_a: &mut u32, _b: &mut u32) {}
2
3macro_rules! x10 {
4 ($($t:tt)*) => {
5 $($t)* $($t)* $($t)* $($t)* $($t)*
6 $($t)* $($t)* $($t)* $($t)* $($t)*
7 }
8}
9
10#[allow(unused_assignments)]
11fn main() {
12 let mut x = 1;
13
14 get_pair(&mut x, &mut x);
15 //~^ ERROR: cannot borrow `x` as mutable more than once at a time
16
17 x10! { x10!{ x10!{ if x > 0 { x += 2 } else { x += 1 } } } }
18}