]>
Commit | Line | Data |
---|---|---|
ba9703b0 XL |
1 | fn get_pair(_a: &mut u32, _b: &mut u32) {} |
2 | ||
3 | macro_rules! x10 { | |
4 | ($($t:tt)*) => { | |
5 | $($t)* $($t)* $($t)* $($t)* $($t)* | |
6 | $($t)* $($t)* $($t)* $($t)* $($t)* | |
7 | } | |
8 | } | |
9 | ||
10 | #[allow(unused_assignments)] | |
11 | fn 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 | } |