5 fn foo<T: Add<Output=T> + Clone>([x, y, z]: [T; 3]) -> (T, T, T) {
6 (x.clone(), x.clone() + y.clone(), x + y + z)
8 fn bar(a: &'static str, b: &'static str) -> [&'static str; 4] {
13 assert_eq!(foo([1, 2, 3]), (1, 3, 6));
15 let [a, b, c, d] = bar("foo", "bar");
21 let [a, _, _, d] = bar("baz", "foo");
25 let out = bar("baz", "foo");
26 let [a, xs @ .., d] = out;
28 assert_eq!(xs, ["foo", "foo"]);