1 error[E0382]: borrow of moved value: `x`
2 --> $DIR/moves-based-on-type-exprs.rs:12:11
4 LL | let x = "hi".to_string();
5 | - move occurs because `x` has type `String`, which does not implement the `Copy` trait
6 LL | let _y = Foo { f:x };
9 | ^^ value borrowed here after move
11 help: consider cloning the value if the performance cost is acceptable
13 LL | let _y = Foo { f:x.clone() };
16 error[E0382]: borrow of moved value: `x`
17 --> $DIR/moves-based-on-type-exprs.rs:18:11
19 LL | let x = "hi".to_string();
20 | - move occurs because `x` has type `String`, which does not implement the `Copy` trait
24 | ^^ value borrowed here after move
26 help: consider cloning the value if the performance cost is acceptable
28 LL | let _y = (x.clone(), 3);
31 error[E0382]: borrow of moved value: `x`
32 --> $DIR/moves-based-on-type-exprs.rs:35:11
34 LL | let x = "hi".to_string();
35 | - move occurs because `x` has type `String`, which does not implement the `Copy` trait
41 | ^^ value borrowed here after move
43 help: consider cloning the value if the performance cost is acceptable
48 error[E0382]: borrow of moved value: `y`
49 --> $DIR/moves-based-on-type-exprs.rs:36:11
51 LL | let y = "ho".to_string();
52 | - move occurs because `y` has type `String`, which does not implement the `Copy` trait
58 | ^^ value borrowed here after move
60 help: consider cloning the value if the performance cost is acceptable
65 error[E0382]: borrow of moved value: `x`
66 --> $DIR/moves-based-on-type-exprs.rs:46:11
68 LL | let x = "hi".to_string();
69 | - move occurs because `x` has type `String`, which does not implement the `Copy` trait
75 | ^^ value borrowed here after move
77 help: consider cloning the value if the performance cost is acceptable
79 LL | true => x.clone(),
82 error[E0382]: borrow of moved value: `y`
83 --> $DIR/moves-based-on-type-exprs.rs:47:11
85 LL | let y = "ho".to_string();
86 | - move occurs because `y` has type `String`, which does not implement the `Copy` trait
92 | ^^ value borrowed here after move
94 help: consider cloning the value if the performance cost is acceptable
96 LL | false => y.clone()
99 error[E0382]: borrow of moved value: `x`
100 --> $DIR/moves-based-on-type-exprs.rs:58:11
102 LL | let x = "hi".to_string();
103 | - move occurs because `x` has type `String`, which does not implement the `Copy` trait
105 LL | _ if guard(x) => 10,
109 | ^^ value borrowed here after move
111 note: consider changing this parameter type in function `guard` to borrow instead if owning the value isn't necessary
112 --> $DIR/moves-based-on-type-exprs.rs:6:14
114 LL | fn guard(_s: String) -> bool {panic!()}
115 | ----- ^^^^^^ this parameter takes ownership of the value
118 help: consider cloning the value if the performance cost is acceptable
120 LL | _ if guard(x.clone()) => 10,
123 error[E0382]: borrow of moved value: `x`
124 --> $DIR/moves-based-on-type-exprs.rs:65:11
126 LL | let x = "hi".to_string();
127 | - move occurs because `x` has type `String`, which does not implement the `Copy` trait
131 | ^^ value borrowed here after move
133 help: consider cloning the value if the performance cost is acceptable
135 LL | let _y = [x.clone()];
138 error[E0382]: borrow of moved value: `x`
139 --> $DIR/moves-based-on-type-exprs.rs:71:11
141 LL | let x = "hi".to_string();
142 | - move occurs because `x` has type `String`, which does not implement the `Copy` trait
143 LL | let _y = vec![x];
146 | ^^ value borrowed here after move
148 help: consider cloning the value if the performance cost is acceptable
150 LL | let _y = vec![x.clone()];
153 error[E0382]: borrow of moved value: `x`
154 --> $DIR/moves-based-on-type-exprs.rs:77:11
156 LL | let x = vec!["hi".to_string()];
157 | - move occurs because `x` has type `Vec<String>`, which does not implement the `Copy` trait
158 LL | let _y = x.into_iter().next().unwrap();
159 | ----------- `x` moved due to this method call
161 | ^^ value borrowed here after move
163 note: `into_iter` takes ownership of the receiver `self`, which moves `x`
164 --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
165 help: consider cloning the value if the performance cost is acceptable
167 LL | let _y = x.clone().into_iter().next().unwrap();
170 error[E0382]: borrow of moved value: `x`
171 --> $DIR/moves-based-on-type-exprs.rs:83:11
173 LL | let x = vec!["hi".to_string()];
174 | - move occurs because `x` has type `Vec<String>`, which does not implement the `Copy` trait
175 LL | let _y = [x.into_iter().next().unwrap(); 1];
176 | ----------- `x` moved due to this method call
178 | ^^ value borrowed here after move
180 note: `into_iter` takes ownership of the receiver `self`, which moves `x`
181 --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
182 help: consider cloning the value if the performance cost is acceptable
184 LL | let _y = [x.clone().into_iter().next().unwrap(); 1];
187 error: aborting due to 11 previous errors
189 For more information about this error, try `rustc --explain E0382`.