e2807a4565
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.
11 lines
218 B
Rust
11 lines
218 B
Rust
pub fn main() {
|
|
let x = &[1, 2, 3, 4, 5];
|
|
if !x.is_empty() {
|
|
let el = match x {
|
|
[1, ..ref tail] => &tail[0],
|
|
_ => unreachable!()
|
|
};
|
|
printfln!("%d", *el);
|
|
}
|
|
}
|