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.
9 lines
213 B
Rust
9 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];
|
|
}
|