]> git.lizzy.rs Git - rust.git/blob - tests/ui/array-slice-vec/vec-matching-legal-tail-element-borrow.rs
Merge commit '1480cea393d0cee195e59949eabdfbcf1230f7f9' into clippyup
[rust.git] / tests / ui / array-slice-vec / vec-matching-legal-tail-element-borrow.rs
1 // run-pass
2
3 #![allow(unused_variables)]
4
5 pub fn main() {
6     let x = &[1, 2, 3, 4, 5];
7     let x: &[isize] = &[1, 2, 3, 4, 5];
8     if !x.is_empty() {
9         let el = match x {
10             &[1, ref tail @ ..] => &tail[0],
11             _ => unreachable!()
12         };
13         println!("{}", *el);
14     }
15 }