diff --git a/src/test/run-pass/issue-25579.rs b/src/test/compile-fail/issue-25579.rs similarity index 60% rename from src/test/run-pass/issue-25579.rs rename to src/test/compile-fail/issue-25579.rs index 53fe67cfc5a..95b07b208d1 100644 --- a/src/test/run-pass/issue-25579.rs +++ b/src/test/compile-fail/issue-25579.rs @@ -9,19 +9,19 @@ // except according to those terms. enum Sexpression { - Num(()), - Cons(&'static mut Sexpression) + Num(()), + Cons(&'static mut Sexpression) } -fn causes_ice(mut l: &mut Sexpression) -{ +fn causes_ice(mut l: &mut Sexpression) { loop { match l { &mut Sexpression::Num(ref mut n) => {}, - &mut Sexpression::Cons(ref mut expr) => { - l = &mut **expr; + &mut Sexpression::Cons(ref mut expr) => { //~ ERROR cannot borrow `l.0` as mutable more than once at a time [E0499] + //~| ERROR cannot borrow `l.0` as mutable more than once at a time [E0499] + l = &mut **expr; //~ ERROR cannot assign to `l` because it is borrowed [E0506] } }} } fn main() { -} +} \ No newline at end of file