summaryrefslogtreecommitdiffstats
path: root/tests/ui/binding/irrefutable-slice-patterns.rs
blob: 048e1e5e9b4b6b81297e637a6abb2423ddf49369 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// run-pass

// Regression test for #47096.

fn foo(s: &[i32]) -> &[i32] {
    let &[ref xs @ ..] = s;
    xs
}

fn main() {
    let x = [1, 2, 3];
    let y = foo(&x);
    assert_eq!(x, y);
}