Sign in
android
/
toolchain
/
rustc
/
refs/heads/main
/
.
/
tests
/
ui
/
array-slice-vec
/
vec-matching-legal-tail-element-borrow.rs
blob: 2493eca2c3aa02f73d3095c27c9ba224b581df12 [
file
] [
log
] [
blame
] [
edit
]
//@ run-pass
#![
allow
(
unused_variables
)]
pub
fn
main
()
{
let
x
=
&[
1
,
2
,
3
,
4
,
5
];
let
x
:
&[
isize
]
=
&[
1
,
2
,
3
,
4
,
5
];
if
!
x
.
is_empty
()
{
let
el
=
match
x
{
&[
1
,
ref
tail
@
..]
=>
&
tail
[
0
],
_
=>
unreachable
!()
};
println
!(
"{}"
,
*
el
);
}
}