Rollup merge of #70176 - rylev:ice-tests, r=Centril
Add tests for #58319 and #65131 Fixes #58319 and fixes #65131
This commit is contained in:
commit
855eac345a
621
src/test/ui/issues/issue-58319.rs
Normal file
621
src/test/ui/issues/issue-58319.rs
Normal file
@ -0,0 +1,621 @@
|
||||
// run-pass
|
||||
fn main() {}
|
||||
#[derive(Clone)]
|
||||
pub struct Little;
|
||||
#[derive(Clone)]
|
||||
pub struct Big(
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
Little,
|
||||
);
|
18
src/test/ui/issues/issue-65131.rs
Normal file
18
src/test/ui/issues/issue-65131.rs
Normal file
@ -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 } } } }
|
||||
}
|
12
src/test/ui/issues/issue-65131.stderr
Normal file
12
src/test/ui/issues/issue-65131.stderr
Normal file
@ -0,0 +1,12 @@
|
||||
error[E0499]: cannot borrow `x` as mutable more than once at a time
|
||||
--> $DIR/issue-65131.rs:14:22
|
||||
|
|
||||
LL | get_pair(&mut x, &mut x);
|
||||
| -------- ------ ^^^^^^ second mutable borrow occurs here
|
||||
| | |
|
||||
| | first mutable borrow occurs here
|
||||
| first borrow later used by call
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0499`.
|
Loading…
Reference in New Issue
Block a user