]>
Commit | Line | Data |
---|---|---|
48663c56 XL |
1 | error[E0382]: borrow of moved value: `x` |
2 | --> $DIR/moves-based-on-type-exprs.rs:12:11 | |
b7449926 | 3 | | |
48663c56 | 4 | LL | let x = "hi".to_string(); |
1b1a35ee | 5 | | - move occurs because `x` has type `String`, which does not implement the `Copy` trait |
b7449926 XL |
6 | LL | let _y = Foo { f:x }; |
7 | | - value moved here | |
532ac7d7 | 8 | LL | touch(&x); |
48663c56 | 9 | | ^^ value borrowed here after move |
b7449926 | 10 | |
48663c56 XL |
11 | error[E0382]: borrow of moved value: `x` |
12 | --> $DIR/moves-based-on-type-exprs.rs:18:11 | |
b7449926 | 13 | | |
48663c56 | 14 | LL | let x = "hi".to_string(); |
1b1a35ee | 15 | | - move occurs because `x` has type `String`, which does not implement the `Copy` trait |
b7449926 XL |
16 | LL | let _y = (x, 3); |
17 | | - value moved here | |
532ac7d7 | 18 | LL | touch(&x); |
48663c56 | 19 | | ^^ value borrowed here after move |
b7449926 | 20 | |
48663c56 XL |
21 | error[E0382]: borrow of moved value: `x` |
22 | --> $DIR/moves-based-on-type-exprs.rs:35:11 | |
b7449926 | 23 | | |
48663c56 | 24 | LL | let x = "hi".to_string(); |
1b1a35ee | 25 | | - move occurs because `x` has type `String`, which does not implement the `Copy` trait |
48663c56 | 26 | ... |
b7449926 XL |
27 | LL | x |
28 | | - value moved here | |
29 | ... | |
532ac7d7 | 30 | LL | touch(&x); |
48663c56 | 31 | | ^^ value borrowed here after move |
b7449926 | 32 | |
48663c56 XL |
33 | error[E0382]: borrow of moved value: `y` |
34 | --> $DIR/moves-based-on-type-exprs.rs:36:11 | |
b7449926 | 35 | | |
48663c56 | 36 | LL | let y = "ho".to_string(); |
1b1a35ee | 37 | | - move occurs because `y` has type `String`, which does not implement the `Copy` trait |
48663c56 | 38 | ... |
b7449926 XL |
39 | LL | y |
40 | | - value moved here | |
41 | ... | |
532ac7d7 | 42 | LL | touch(&y); |
48663c56 | 43 | | ^^ value borrowed here after move |
b7449926 | 44 | |
48663c56 XL |
45 | error[E0382]: borrow of moved value: `x` |
46 | --> $DIR/moves-based-on-type-exprs.rs:46:11 | |
b7449926 | 47 | | |
48663c56 | 48 | LL | let x = "hi".to_string(); |
1b1a35ee | 49 | | - move occurs because `x` has type `String`, which does not implement the `Copy` trait |
48663c56 | 50 | ... |
b7449926 XL |
51 | LL | true => x, |
52 | | - value moved here | |
53 | ... | |
532ac7d7 | 54 | LL | touch(&x); |
48663c56 | 55 | | ^^ value borrowed here after move |
b7449926 | 56 | |
48663c56 XL |
57 | error[E0382]: borrow of moved value: `y` |
58 | --> $DIR/moves-based-on-type-exprs.rs:47:11 | |
b7449926 | 59 | | |
48663c56 | 60 | LL | let y = "ho".to_string(); |
1b1a35ee | 61 | | - move occurs because `y` has type `String`, which does not implement the `Copy` trait |
48663c56 | 62 | ... |
b7449926 XL |
63 | LL | false => y |
64 | | - value moved here | |
65 | ... | |
532ac7d7 | 66 | LL | touch(&y); |
48663c56 | 67 | | ^^ value borrowed here after move |
b7449926 | 68 | |
48663c56 XL |
69 | error[E0382]: borrow of moved value: `x` |
70 | --> $DIR/moves-based-on-type-exprs.rs:58:11 | |
b7449926 | 71 | | |
48663c56 | 72 | LL | let x = "hi".to_string(); |
1b1a35ee | 73 | | - move occurs because `x` has type `String`, which does not implement the `Copy` trait |
48663c56 | 74 | ... |
b7449926 XL |
75 | LL | _ if guard(x) => 10, |
76 | | - value moved here | |
77 | ... | |
532ac7d7 | 78 | LL | touch(&x); |
48663c56 | 79 | | ^^ value borrowed here after move |
b7449926 | 80 | |
48663c56 XL |
81 | error[E0382]: borrow of moved value: `x` |
82 | --> $DIR/moves-based-on-type-exprs.rs:65:11 | |
b7449926 | 83 | | |
48663c56 | 84 | LL | let x = "hi".to_string(); |
1b1a35ee | 85 | | - move occurs because `x` has type `String`, which does not implement the `Copy` trait |
b7449926 XL |
86 | LL | let _y = [x]; |
87 | | - value moved here | |
532ac7d7 | 88 | LL | touch(&x); |
48663c56 | 89 | | ^^ value borrowed here after move |
b7449926 | 90 | |
48663c56 XL |
91 | error[E0382]: borrow of moved value: `x` |
92 | --> $DIR/moves-based-on-type-exprs.rs:71:11 | |
b7449926 | 93 | | |
48663c56 | 94 | LL | let x = "hi".to_string(); |
1b1a35ee | 95 | | - move occurs because `x` has type `String`, which does not implement the `Copy` trait |
b7449926 XL |
96 | LL | let _y = vec![x]; |
97 | | - value moved here | |
532ac7d7 | 98 | LL | touch(&x); |
48663c56 | 99 | | ^^ value borrowed here after move |
b7449926 | 100 | |
48663c56 XL |
101 | error[E0382]: borrow of moved value: `x` |
102 | --> $DIR/moves-based-on-type-exprs.rs:77:11 | |
b7449926 | 103 | | |
48663c56 | 104 | LL | let x = vec!["hi".to_string()]; |
1b1a35ee | 105 | | - move occurs because `x` has type `Vec<String>`, which does not implement the `Copy` trait |
b7449926 | 106 | LL | let _y = x.into_iter().next().unwrap(); |
f035d41b | 107 | | ----------- `x` moved due to this method call |
532ac7d7 | 108 | LL | touch(&x); |
48663c56 | 109 | | ^^ value borrowed here after move |
f035d41b XL |
110 | | |
111 | note: this function consumes the receiver `self` by taking ownership of it, which moves `x` | |
3dfed10e | 112 | --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL |
f035d41b XL |
113 | | |
114 | LL | fn into_iter(self) -> Self::IntoIter; | |
115 | | ^^^^ | |
b7449926 | 116 | |
48663c56 XL |
117 | error[E0382]: borrow of moved value: `x` |
118 | --> $DIR/moves-based-on-type-exprs.rs:83:11 | |
b7449926 | 119 | | |
48663c56 | 120 | LL | let x = vec!["hi".to_string()]; |
1b1a35ee | 121 | | - move occurs because `x` has type `Vec<String>`, which does not implement the `Copy` trait |
b7449926 | 122 | LL | let _y = [x.into_iter().next().unwrap(); 1]; |
f035d41b | 123 | | ----------- `x` moved due to this method call |
532ac7d7 | 124 | LL | touch(&x); |
48663c56 | 125 | | ^^ value borrowed here after move |
f035d41b XL |
126 | | |
127 | note: this function consumes the receiver `self` by taking ownership of it, which moves `x` | |
3dfed10e | 128 | --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL |
f035d41b XL |
129 | | |
130 | LL | fn into_iter(self) -> Self::IntoIter; | |
131 | | ^^^^ | |
b7449926 XL |
132 | |
133 | error: aborting due to 11 previous errors | |
134 | ||
135 | For more information about this error, try `rustc --explain E0382`. |