9 fn add(self, _rhs: Self) -> () {}
14 fn use_box_self(self: Box<Self>) {}
15 fn use_pin_box_self(self: Pin<Box<Self>>) {}
16 fn use_rc_self(self: Rc<Self>) {}
17 fn use_mut_self(&mut self) -> &mut Self { self }
20 struct Container(Vec<bool>);
23 fn custom_into_iter(self) -> impl Iterator<Item = bool> {
28 fn move_out(val: Container) {
29 val.0.into_iter().next();
30 val.0; //~ ERROR use of moved
34 foo; //~ ERROR use of moved
37 second_foo.use_self();
38 second_foo; //~ ERROR use of moved
40 let boxed_foo = Box::new(Foo);
41 boxed_foo.use_box_self();
42 boxed_foo; //~ ERROR use of moved
44 let pin_box_foo = Box::pin(Foo);
45 pin_box_foo.use_pin_box_self();
46 pin_box_foo; //~ ERROR use of moved
48 let mut mut_foo = Foo;
49 let ret = mut_foo.use_mut_self();
50 mut_foo; //~ ERROR cannot move out
53 let rc_foo = Rc::new(Foo);
55 rc_foo; //~ ERROR use of moved
59 foo_add; //~ ERROR use of moved
61 let implicit_into_iter = vec![true];
62 for _val in implicit_into_iter {}
63 implicit_into_iter; //~ ERROR use of moved
65 let explicit_into_iter = vec![true];
66 for _val in explicit_into_iter.into_iter() {}
67 explicit_into_iter; //~ ERROR use of moved
69 let container = Container(vec![]);
70 for _val in container.custom_into_iter() {}
71 container; //~ ERROR use of moved
75 foo2.use_self(); //~ ERROR use of moved