1 // Tests that references to move-by-default values trigger moves when
2 // they occur as part of various kinds of expressions.
8 let x = "hi".to_string();
9 //~^ NOTE move occurs because `x` has type `String`
11 //~^ NOTE value moved here
12 touch(&x); //~ ERROR borrow of moved value: `x`
13 //~^ NOTE value borrowed here after move
17 let x = "hi".to_string();
18 //~^ NOTE move occurs because `x` has type `String`
19 let _y = Foo { f:(((x))) };
20 //~^ NOTE value moved here
21 touch(&x); //~ ERROR borrow of moved value: `x`
22 //~^ NOTE value borrowed here after move
26 let x = "hi".to_string();
27 let _y = Foo { f:x.clone() };
32 let x = "hi".to_string();
33 let _y = Foo { f:(x).clone() };
38 let x = "hi".to_string();
39 let _y = Foo { f:((x)).clone() };
44 let x = "hi".to_string();
45 let _y = Foo { f:(((((((x)).clone()))))) };