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