fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
344 B19 linesraw
1// run-rustfix
2struct X {
3    x: String,
4}
5
6impl Drop for X {
7    fn drop(&mut self) {
8        println!("value: {}", self.x);
9    }
10}
11
12fn main() {
13    let x = X { x: "hello".to_string() };
14
15    match x {
16    //~^ ERROR cannot move out of type `X`, which implements the `Drop` trait
17        X { x: ref y } => println!("contents: {}", y)
18    }
19}