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