rust/src/test/compile-fail/borrowck-vec-pattern-move-tail.rs
Chris Morgan e2807a4565 Replace unreachable() calls with unreachable!().
This is the second of two parts of #8991, now possible as a new snapshot
has been made. (The first part implemented the unreachable!() macro; it
was #8992, 6b7b8f2682.)

``std::util::unreachable()`` is removed summarily; any code which used
it should now use the ``unreachable!()`` macro.

Closes #9312.

Closes #8991.
2013-09-19 15:04:03 +10:00

10 lines
213 B
Rust

fn main() {
let mut a = [1, 2, 3, 4];
let t = match a {
[1, 2, ..tail] => tail,
_ => unreachable!()
};
a[0] = 0; //~ ERROR cannot assign to `a[]` because it is borrowed
t[0];
}