2013-02-01 21:43:17 -06:00
|
|
|
pub fn main() {
|
2012-12-15 17:13:55 -06:00
|
|
|
let x = &[1, 2, 3, 4, 5];
|
|
|
|
if !x.is_empty() {
|
|
|
|
let el = match x {
|
2013-01-24 21:33:48 -06:00
|
|
|
[1, ..ref tail] => &tail[0],
|
2013-01-07 20:54:28 -06:00
|
|
|
_ => ::core::util::unreachable()
|
2012-12-15 17:13:55 -06:00
|
|
|
};
|
|
|
|
io::println(fmt!("%d", *el));
|
|
|
|
}
|
|
|
|
}
|