fork/rust

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

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

master
358 B21 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 unwrap(x: X) -> String {
13    let X { x: ref y } = x; //~ ERROR cannot move out of type
14    y.to_string()
15}
16
17fn main() {
18    let x = X { x: "hello".to_string() };
19    let y = unwrap(x);
20    println!("contents: {}", y);
21}