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