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: this function takes ownership of the receiver `self`, which moves `val.0`
10 --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
12 LL | fn into_iter(self) -> Self::IntoIter;
14 = note: move occurs because `val.0` has type `Vec<bool>`, which does not implement the `Copy` trait
16 error[E0382]: use of moved value: `foo`
17 --> $DIR/move-fn-self-receiver.rs:34:5
20 | --- move occurs because `foo` has type `Foo`, which does not implement the `Copy` trait
22 | ---------- `foo` moved due to this method call
24 | ^^^ value used here after move
26 note: this function takes ownership of the receiver `self`, which moves `foo`
27 --> $DIR/move-fn-self-receiver.rs:13:17
29 LL | fn use_self(self) {}
32 error[E0382]: use of moved value: `second_foo`
33 --> $DIR/move-fn-self-receiver.rs:38:5
35 LL | let second_foo = Foo;
36 | ---------- move occurs because `second_foo` has type `Foo`, which does not implement the `Copy` trait
37 LL | second_foo.use_self();
38 | ---------- `second_foo` moved due to this method call
40 | ^^^^^^^^^^ value used here after move
42 error[E0382]: use of moved value: `boxed_foo`
43 --> $DIR/move-fn-self-receiver.rs:42:5
45 LL | let boxed_foo = Box::new(Foo);
46 | --------- move occurs because `boxed_foo` has type `Box<Foo>`, which does not implement the `Copy` trait
47 LL | boxed_foo.use_box_self();
48 | -------------- `boxed_foo` moved due to this method call
50 | ^^^^^^^^^ value used here after move
52 note: this function takes ownership of the receiver `self`, which moves `boxed_foo`
53 --> $DIR/move-fn-self-receiver.rs:14:21
55 LL | fn use_box_self(self: Box<Self>) {}
58 error[E0382]: use of moved value: `pin_box_foo`
59 --> $DIR/move-fn-self-receiver.rs:46:5
61 LL | let pin_box_foo = Box::pin(Foo);
62 | ----------- move occurs because `pin_box_foo` has type `Pin<Box<Foo>>`, which does not implement the `Copy` trait
63 LL | pin_box_foo.use_pin_box_self();
64 | ------------------ `pin_box_foo` moved due to this method call
66 | ^^^^^^^^^^^ value used here after move
68 note: this function takes ownership of the receiver `self`, which moves `pin_box_foo`
69 --> $DIR/move-fn-self-receiver.rs:15:25
71 LL | fn use_pin_box_self(self: Pin<Box<Self>>) {}
74 error[E0505]: cannot move out of `mut_foo` because it is borrowed
75 --> $DIR/move-fn-self-receiver.rs:50:5
77 LL | let ret = mut_foo.use_mut_self();
78 | ---------------------- borrow of `mut_foo` occurs here
80 | ^^^^^^^ move out of `mut_foo` occurs here
82 | --- borrow later used here
84 error[E0382]: use of moved value: `rc_foo`
85 --> $DIR/move-fn-self-receiver.rs:55:5
87 LL | let rc_foo = Rc::new(Foo);
88 | ------ move occurs because `rc_foo` has type `Rc<Foo>`, which does not implement the `Copy` trait
89 LL | rc_foo.use_rc_self();
90 | ------------- `rc_foo` moved due to this method call
92 | ^^^^^^ value used here after move
94 note: this function takes ownership of the receiver `self`, which moves `rc_foo`
95 --> $DIR/move-fn-self-receiver.rs:16:20
97 LL | fn use_rc_self(self: Rc<Self>) {}
100 error[E0382]: use of moved value: `foo_add`
101 --> $DIR/move-fn-self-receiver.rs:59:5
103 LL | let foo_add = Foo;
104 | ------- move occurs because `foo_add` has type `Foo`, which does not implement the `Copy` trait
106 | ------------- `foo_add` moved due to usage in operator
108 | ^^^^^^^ value used here after move
110 note: calling this operator moves the left-hand side
111 --> $SRC_DIR/core/src/ops/arith.rs:LL:COL
113 LL | fn add(self, rhs: Rhs) -> Self::Output;
116 error[E0382]: use of moved value: `implicit_into_iter`
117 --> $DIR/move-fn-self-receiver.rs:63:5
119 LL | let implicit_into_iter = vec![true];
120 | ------------------ move occurs because `implicit_into_iter` has type `Vec<bool>`, which does not implement the `Copy` trait
121 LL | for _val in implicit_into_iter {}
122 | ------------------ `implicit_into_iter` moved due to this implicit call to `.into_iter()`
123 LL | implicit_into_iter;
124 | ^^^^^^^^^^^^^^^^^^ value used here after move
126 help: consider iterating over a slice of the `Vec<bool>`'s content to avoid moving into the `for` loop
128 LL | for _val in &implicit_into_iter {}
131 error[E0382]: use of moved value: `explicit_into_iter`
132 --> $DIR/move-fn-self-receiver.rs:67:5
134 LL | let explicit_into_iter = vec![true];
135 | ------------------ move occurs because `explicit_into_iter` has type `Vec<bool>`, which does not implement the `Copy` trait
136 LL | for _val in explicit_into_iter.into_iter() {}
137 | ----------- `explicit_into_iter` moved due to this method call
138 LL | explicit_into_iter;
139 | ^^^^^^^^^^^^^^^^^^ value used here after move
141 error[E0382]: use of moved value: `container`
142 --> $DIR/move-fn-self-receiver.rs:71:5
144 LL | let container = Container(vec![]);
145 | --------- move occurs because `container` has type `Container`, which does not implement the `Copy` trait
146 LL | for _val in container.custom_into_iter() {}
147 | ------------------ `container` moved due to this method call
149 | ^^^^^^^^^ value used here after move
151 note: this function takes ownership of the receiver `self`, which moves `container`
152 --> $DIR/move-fn-self-receiver.rs:23:25
154 LL | fn custom_into_iter(self) -> impl Iterator<Item = bool> {
157 error[E0382]: use of moved value: `foo2`
158 --> $DIR/move-fn-self-receiver.rs:75:9
161 | ---- move occurs because `foo2` has type `Foo`, which does not implement the `Copy` trait
163 LL | foo2.use_self();
164 | ^^^^ ---------- `foo2` moved due to this method call, in previous iteration of loop
166 error: aborting due to 12 previous errors
168 Some errors have detailed explanations: E0382, E0505.
169 For more information about an error, try `rustc --explain E0382`.