2 // Matching on a DST struct should not trigger an LLVM assertion.
4 struct Foo<T: ?Sized> {
14 fn get(&self) -> i32 {
19 fn check_val(val: &Foo<[u8]>) {
27 fn check_dst_val(val: &Foo<[u8]>) {
29 Foo { ref inner, .. } => {
30 assert_eq!(inner, [1, 2, 3]);
35 fn check_both(val: &Foo<[u8]>) {
37 Foo { a, ref inner } => {
39 assert_eq!(inner, [1, 2, 3]);
44 fn check_trait_obj(val: &Foo<dyn Get>) {
46 Foo { a, ref inner } => {
48 assert_eq!(inner.get(), 32);
54 let foo: &Foo<[u8]> = &Foo { a: 32, inner: [1, 2, 3] };
59 let foo: &Foo<dyn Get> = &Foo { a: 32, inner: 32 };