]> git.lizzy.rs Git - rust.git/blob - src/test/ui/binding/match-implicit-copy-unique.rs
Auto merge of #87284 - Aaron1011:remove-paren-special, r=petrochenkov
[rust.git] / src / test / ui / binding / match-implicit-copy-unique.rs
1 // run-pass
2 #![allow(non_shorthand_field_patterns)]
3 #![feature(box_syntax)]
4
5 struct Pair { a: Box<isize>, b: Box<isize> }
6
7 pub fn main() {
8     let mut x: Box<_> = box Pair {a: box 10, b: box 20};
9     let x_internal = &mut *x;
10     match *x_internal {
11       Pair {a: ref mut a, b: ref mut _b} => {
12         assert_eq!(**a, 10);
13         *a = box 30;
14         assert_eq!(**a, 30);
15       }
16     }
17 }