]> git.lizzy.rs Git - rust.git/blob - src/test/ui/binding/zero_sized_subslice_match.rs
Simplify SaveHandler trait
[rust.git] / src / test / ui / binding / zero_sized_subslice_match.rs
1 // run-pass
2 #![feature(slice_patterns)]
3
4 fn main() {
5     let x = [(), ()];
6
7     // The subslice used to go out of bounds for zero-sized array items, check that this doesn't
8     // happen anymore
9     match x {
10         [_, ref y..] => assert_eq!(&x[1] as *const (), &y[0] as *const ())
11     }
12 }