]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-65131.rs
Enable full revision in const generics ui tests
[rust.git] / src / test / ui / issues / issue-65131.rs
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 }