]> git.lizzy.rs Git - rust.git/blob - src/test/ui/disallowed-deconstructing/disallowed-deconstructing-destructing-struct-match.rs
Add 'library/portable-simd/' from commit '1ce1c645cf27c4acdefe6ec8a11d1f0491954a99'
[rust.git] / src / test / ui / disallowed-deconstructing / disallowed-deconstructing-destructing-struct-match.rs
1 struct X {
2     x: String,
3 }
4
5 impl Drop for X {
6     fn drop(&mut self) {
7         println!("value: {}", self.x);
8     }
9 }
10
11 fn main() {
12     let x = X { x: "hello".to_string() };
13
14     match x {
15     //~^ ERROR cannot move out of type `X`, which implements the `Drop` trait
16         X { x: y } => println!("contents: {}", y)
17     }
18 }