]> git.lizzy.rs Git - rust.git/blob - tests/ui/binding/zero_sized_subslice_match.rs
Rollup merge of #106441 - mllken:abstract-socket-noref, r=joshtriplett
[rust.git] / tests / ui / binding / zero_sized_subslice_match.rs
1 // run-pass
2
3 fn main() {
4     let x = [(), ()];
5
6     // The subslice used to go out of bounds for zero-sized array items, check that this doesn't
7     // happen anymore
8     match x {
9         [_, ref y @ ..] => assert_eq!(&x[1] as *const (), &y[0] as *const ())
10     }
11 }