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
194 B
Rust
Raw Normal View History

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