diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-65131.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-65131.rs b/src/test/ui/issues/issue-65131.rs new file mode 100644 index 000000000..8b5345da9 --- /dev/null +++ b/src/test/ui/issues/issue-65131.rs @@ -0,0 +1,18 @@ +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 } } } } +} |