about summary refs log tree commit diff
path: root/src/tools/miri/tests/pass/subslice_array.rs
blob: 9b6b12d748adbf4d2016f3d61f9ddf7988c63bc5 (plain)
1
2
3
4
5
6
7
8
9
10
11
fn bar(a: &'static str, b: &'static str) -> [&'static str; 4] {
    [a, b, b, a]
}

fn main() {
    let out = bar("baz", "foo");
    let [a, xs @ .., d] = out;
    assert_eq!(a, "baz");
    assert_eq!(xs, ["foo", "foo"]);
    assert_eq!(d, "baz");
}