fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1// run-rustfix 2#![allow(unused)] 3struct S(String); 4impl Drop for S { 5 fn drop(&mut self) { } 6} 7 8fn move_in_match() { 9 match S("foo".to_string()) { 10 //~^ ERROR cannot move out of type `S`, which implements the `Drop` trait 11 S(ref _s) => {} 12 } 13} 14 15fn move_in_let() { 16 let S(ref _s) = S("foo".to_string()); 17 //~^ ERROR cannot move out of type `S`, which implements the `Drop` trait 18} 19 20fn move_in_fn_arg(S(ref _s): S) { 21 //~^ ERROR cannot move out of type `S`, which implements the `Drop` trait 22} 23 24fn main() {}