1 error[E0382]: use of moved value: `val.0`
2 --> $DIR/move-fn-self-receiver.rs:30:5
4 LL | val.0.into_iter().next();
5 | ----------- `val.0` moved due to this method call
7 | ^^^^^ value used here after move
9 note: `into_iter` takes ownership of the receiver `self`, which moves `val.0`
10 --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
11 = note: move occurs because `val.0` has type `Vec<bool>`, which does not implement the `Copy` trait
12 help: you can `clone` the value and consume it, but this might not be your desired behavior
14 LL | val.0.clone().into_iter().next();
17 error[E0382]: use of moved value: `foo`
18 --> $DIR/move-fn-self-receiver.rs:34:5
21 | --- move occurs because `foo` has type `Foo`, which does not implement the `Copy` trait
23 | ---------- `foo` moved due to this method call
25 | ^^^ value used here after move
27 note: `Foo::use_self` takes ownership of the receiver `self`, which moves `foo`
28 --> $DIR/move-fn-self-receiver.rs:13:17
30 LL | fn use_self(self) {}
33 error[E0382]: use of moved value: `second_foo`
34 --> $DIR/move-fn-self-receiver.rs:38:5
36 LL | let second_foo = Foo;
37 | ---------- move occurs because `second_foo` has type `Foo`, which does not implement the `Copy` trait
38 LL | second_foo.use_self();
39 | ---------- `second_foo` moved due to this method call
41 | ^^^^^^^^^^ value used here after move
43 error[E0382]: use of moved value: `boxed_foo`
44 --> $DIR/move-fn-self-receiver.rs:42:5
46 LL | let boxed_foo = Box::new(Foo);
47 | --------- move occurs because `boxed_foo` has type `Box<Foo>`, which does not implement the `Copy` trait
48 LL | boxed_foo.use_box_self();
49 | -------------- `boxed_foo` moved due to this method call
51 | ^^^^^^^^^ value used here after move
53 note: `Foo::use_box_self` takes ownership of the receiver `self`, which moves `boxed_foo`
54 --> $DIR/move-fn-self-receiver.rs:14:21
56 LL | fn use_box_self(self: Box<Self>) {}
59 error[E0382]: use of moved value: `pin_box_foo`
60 --> $DIR/move-fn-self-receiver.rs:46:5
62 LL | let pin_box_foo = Box::pin(Foo);
63 | ----------- move occurs because `pin_box_foo` has type `Pin<Box<Foo>>`, which does not implement the `Copy` trait
64 LL | pin_box_foo.use_pin_box_self();
65 | ------------------ `pin_box_foo` moved due to this method call
67 | ^^^^^^^^^^^ value used here after move
69 note: `Foo::use_pin_box_self` takes ownership of the receiver `self`, which moves `pin_box_foo`
70 --> $DIR/move-fn-self-receiver.rs:15:25
72 LL | fn use_pin_box_self(self: Pin<Box<Self>>) {}
75 error[E0505]: cannot move out of `mut_foo` because it is borrowed
76 --> $DIR/move-fn-self-receiver.rs:50:5
78 LL | let ret = mut_foo.use_mut_self();
79 | ---------------------- borrow of `mut_foo` occurs here
81 | ^^^^^^^ move out of `mut_foo` occurs here
83 | --- borrow later used here
85 error[E0382]: use of moved value: `rc_foo`
86 --> $DIR/move-fn-self-receiver.rs:55:5
88 LL | let rc_foo = Rc::new(Foo);
89 | ------ move occurs because `rc_foo` has type `Rc<Foo>`, which does not implement the `Copy` trait
90 LL | rc_foo.use_rc_self();
91 | ------------- `rc_foo` moved due to this method call
93 | ^^^^^^ value used here after move
95 note: `Foo::use_rc_self` takes ownership of the receiver `self`, which moves `rc_foo`
96 --> $DIR/move-fn-self-receiver.rs:16:20
98 LL | fn use_rc_self(self: Rc<Self>) {}
100 help: you can `clone` the value and consume it, but this might not be your desired behavior
102 LL | rc_foo.clone().use_rc_self();
105 error[E0382]: use of moved value: `foo_add`
106 --> $DIR/move-fn-self-receiver.rs:59:5
108 LL | let foo_add = Foo;
109 | ------- move occurs because `foo_add` has type `Foo`, which does not implement the `Copy` trait
111 | ------------- `foo_add` moved due to usage in operator
113 | ^^^^^^^ value used here after move
115 note: calling this operator moves the left-hand side
116 --> $SRC_DIR/core/src/ops/arith.rs:LL:COL
118 error[E0382]: use of moved value: `implicit_into_iter`
119 --> $DIR/move-fn-self-receiver.rs:63:5
121 LL | let implicit_into_iter = vec![true];
122 | ------------------ move occurs because `implicit_into_iter` has type `Vec<bool>`, which does not implement the `Copy` trait
123 LL | for _val in implicit_into_iter {}
124 | ------------------ `implicit_into_iter` moved due to this implicit call to `.into_iter()`
125 LL | implicit_into_iter;
126 | ^^^^^^^^^^^^^^^^^^ value used here after move
128 help: consider iterating over a slice of the `Vec<bool>`'s content to avoid moving into the `for` loop
130 LL | for _val in &implicit_into_iter {}
133 error[E0382]: use of moved value: `explicit_into_iter`
134 --> $DIR/move-fn-self-receiver.rs:67:5
136 LL | let explicit_into_iter = vec![true];
137 | ------------------ move occurs because `explicit_into_iter` has type `Vec<bool>`, which does not implement the `Copy` trait
138 LL | for _val in explicit_into_iter.into_iter() {}
139 | ----------- `explicit_into_iter` moved due to this method call
140 LL | explicit_into_iter;
141 | ^^^^^^^^^^^^^^^^^^ value used here after move
143 help: you can `clone` the value and consume it, but this might not be your desired behavior
145 LL | for _val in explicit_into_iter.clone().into_iter() {}
148 error[E0382]: use of moved value: `container`
149 --> $DIR/move-fn-self-receiver.rs:71:5
151 LL | let container = Container(vec![]);
152 | --------- move occurs because `container` has type `Container`, which does not implement the `Copy` trait
153 LL | for _val in container.custom_into_iter() {}
154 | ------------------ `container` moved due to this method call
156 | ^^^^^^^^^ value used here after move
158 note: `Container::custom_into_iter` takes ownership of the receiver `self`, which moves `container`
159 --> $DIR/move-fn-self-receiver.rs:23:25
161 LL | fn custom_into_iter(self) -> impl Iterator<Item = bool> {
164 error[E0382]: use of moved value: `foo2`
165 --> $DIR/move-fn-self-receiver.rs:75:9
168 | ---- move occurs because `foo2` has type `Foo`, which does not implement the `Copy` trait
170 | ---- inside of this loop
171 LL | foo2.use_self();
172 | ^^^^ ---------- `foo2` moved due to this method call, in previous iteration of loop
174 error: aborting due to 12 previous errors
176 Some errors have detailed explanations: E0382, E0505.
177 For more information about an error, try `rustc --explain E0382`.