rust/tests/ui/issues/issue-65131.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
408 B
Rust
Raw Normal View History

2020-03-20 07:24:35 -05:00
fn get_pair(_a: &mut u32, _b: &mut u32) {}
macro_rules! x10 {
($($t:tt)*) => {
$($t)* $($t)* $($t)* $($t)* $($t)*
$($t)* $($t)* $($t)* $($t)* $($t)*
}
}
#[allow(unused_assignments)]
fn main() {
let mut x = 1;
get_pair(&mut x, &mut x);
//~^ ERROR: cannot borrow `x` as mutable more than once at a time
x10! { x10!{ x10!{ if x > 0 { x += 2 } else { x += 1 } } } }
}