Navigation Menu

Skip to content

Commit

Permalink
Drive-by: Make assignment conflict tests in borrowck-vec-pattern-nest…
Browse files Browse the repository at this point in the history
…ing.rs robust for NLL.
  • Loading branch information
pnkfelix committed Jun 6, 2018
1 parent fbe7d5b commit 9b24595
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/test/ui/borrowck/borrowck-vec-pattern-nesting.rs
Expand Up @@ -19,6 +19,7 @@ fn a() {
//~^ borrow of `vec[..]` occurs here
vec[0] = box 4; //~ ERROR cannot assign
//~^ assignment to borrowed `vec[..]` occurs here
_a.use_ref();
}
}
}
Expand All @@ -31,6 +32,7 @@ fn b() {
//~^ borrow of `vec[..]` occurs here
vec[0] = box 4; //~ ERROR cannot assign
//~^ assignment to borrowed `vec[..]` occurs here
_b.use_ref();
}
}
}
Expand Down Expand Up @@ -82,3 +84,6 @@ fn e() {
}

fn main() {}

trait Fake { fn use_mut(&mut self) { } fn use_ref(&self) { } }
impl<T> Fake for T { }

0 comments on commit 9b24595

Please sign in to comment.