mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-06 05:33:59 +00:00
15 lines
193 B
Rust
15 lines
193 B
Rust
// 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);
|
|
}
|