rust/tests/ui/binding/irrefutable-slice-patterns.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
193 B
Rust
Raw Normal View History

// run-pass
2019-12-29 18:23:42 -06:00
// Regression test for #47096.
fn foo(s: &[i32]) -> &[i32] {
2019-07-07 18:47:46 -05:00
let &[ref xs @ ..] = s;
xs
}
fn main() {
let x = [1, 2, 3];
let y = foo(&x);
assert_eq!(x, y);
}