mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
14 lines
194 B
Rust
14 lines
194 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);
|
|
}
|