1 // Tests that bindings to move-by-default values trigger moves of the
2 // discriminant. Also tests that the compiler explains the move in
3 // terms of the binding, not the discriminant.
6 fn guard(_s: String) -> bool {panic!()}
10 let x = Foo {f: "hi".to_string()};
16 touch(&x); //~ ERROR borrow of partially moved value: `x`
17 //~^ value borrowed here after partial move
18 //~| partial move occurs because `x.f` has type `String`