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