Tweak move error due to non-Copy
This commit is contained in:
parent
9a595417a2
commit
9c97d73a2d
10 changed files with 31 additions and 175 deletions
|
@ -555,7 +555,6 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
|
||||||
err: &mut DiagnosticBuilder<'a>,
|
err: &mut DiagnosticBuilder<'a>,
|
||||||
binds_to: &[Local],
|
binds_to: &[Local],
|
||||||
) {
|
) {
|
||||||
let mut noncopy_var_spans = Vec::new();
|
|
||||||
for (j, local) in binds_to.into_iter().enumerate() {
|
for (j, local) in binds_to.into_iter().enumerate() {
|
||||||
let bind_to = &self.body.local_decls[*local];
|
let bind_to = &self.body.local_decls[*local];
|
||||||
let binding_span = bind_to.source_info.span;
|
let binding_span = bind_to.source_info.span;
|
||||||
|
@ -573,16 +572,12 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
|
||||||
bind_to.ty,
|
bind_to.ty,
|
||||||
Some(binding_span)
|
Some(binding_span)
|
||||||
);
|
);
|
||||||
} else {
|
|
||||||
noncopy_var_spans.push(binding_span);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if binds_to.len() > 1 {
|
if binds_to.len() > 1 {
|
||||||
err.span_note(
|
err.note("move occurs because these variables have types that \
|
||||||
noncopy_var_spans,
|
don't implement the `Copy` trait",
|
||||||
"move occurs because these variables have types that \
|
|
||||||
don't implement the `Copy` trait",
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,15 +10,7 @@ LL | num2) => (),
|
||||||
LL | Foo::Foo2(num) => (),
|
LL | Foo::Foo2(num) => (),
|
||||||
| --- ...and here
|
| --- ...and here
|
||||||
|
|
|
|
||||||
note: move occurs because these variables have types that don't implement the `Copy` trait
|
= note: move occurs because these variables have types that don't implement the `Copy` trait
|
||||||
--> $DIR/borrowck-move-error-with-note.rs:12:19
|
|
||||||
|
|
|
||||||
LL | Foo::Foo1(num1,
|
|
||||||
| ^^^^
|
|
||||||
LL | num2) => (),
|
|
||||||
| ^^^^
|
|
||||||
LL | Foo::Foo2(num) => (),
|
|
||||||
| ^^^
|
|
||||||
|
|
||||||
error[E0509]: cannot move out of type `S`, which implements the `Drop` trait
|
error[E0509]: cannot move out of type `S`, which implements the `Drop` trait
|
||||||
--> $DIR/borrowck-move-error-with-note.rs:28:11
|
--> $DIR/borrowck-move-error-with-note.rs:28:11
|
||||||
|
@ -31,13 +23,7 @@ LL | f: _s,
|
||||||
LL | g: _t
|
LL | g: _t
|
||||||
| -- ...and here
|
| -- ...and here
|
||||||
|
|
|
|
||||||
note: move occurs because these variables have types that don't implement the `Copy` trait
|
= note: move occurs because these variables have types that don't implement the `Copy` trait
|
||||||
--> $DIR/borrowck-move-error-with-note.rs:31:16
|
|
||||||
|
|
|
||||||
LL | f: _s,
|
|
||||||
| ^^
|
|
||||||
LL | g: _t
|
|
||||||
| ^^
|
|
||||||
|
|
||||||
error[E0507]: cannot move out of `a.a` which is behind a shared reference
|
error[E0507]: cannot move out of `a.a` which is behind a shared reference
|
||||||
--> $DIR/borrowck-move-error-with-note.rs:46:11
|
--> $DIR/borrowck-move-error-with-note.rs:46:11
|
||||||
|
|
|
@ -9,13 +9,7 @@ LL | &[Foo { string: a },
|
||||||
LL | Foo { string: b }] => {
|
LL | Foo { string: b }] => {
|
||||||
| - ...and here
|
| - ...and here
|
||||||
|
|
|
|
||||||
note: move occurs because these variables have types that don't implement the `Copy` trait
|
= note: move occurs because these variables have types that don't implement the `Copy` trait
|
||||||
--> $DIR/borrowck-move-out-of-vec-tail.rs:21:33
|
|
||||||
|
|
|
||||||
LL | &[Foo { string: a },
|
|
||||||
| ^
|
|
||||||
LL | Foo { string: b }] => {
|
|
||||||
| ^
|
|
||||||
help: consider removing the `&`
|
help: consider removing the `&`
|
||||||
|
|
|
|
||||||
LL | [Foo { string: a },
|
LL | [Foo { string: a },
|
||||||
|
|
|
@ -75,12 +75,12 @@ fn e() {
|
||||||
match vec {
|
match vec {
|
||||||
//~^ ERROR cannot move out
|
//~^ ERROR cannot move out
|
||||||
//~| NOTE cannot move out
|
//~| NOTE cannot move out
|
||||||
|
//~| NOTE move occurs because these variables have types
|
||||||
&mut [_a, _b, _c] => {}
|
&mut [_a, _b, _c] => {}
|
||||||
//~^ NOTE data moved here
|
//~^ NOTE data moved here
|
||||||
//~| NOTE and here
|
//~| NOTE and here
|
||||||
//~| NOTE and here
|
//~| NOTE and here
|
||||||
//~| HELP consider removing the `&mut`
|
//~| HELP consider removing the `&mut`
|
||||||
//~| NOTE move occurs because these variables have types
|
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
let a = vec[0]; //~ ERROR cannot move out
|
let a = vec[0]; //~ ERROR cannot move out
|
||||||
|
|
|
@ -97,11 +97,7 @@ LL | &mut [_a, _b, _c] => {}
|
||||||
| | data moved here
|
| | data moved here
|
||||||
| help: consider removing the `&mut`: `[_a, _b, _c]`
|
| help: consider removing the `&mut`: `[_a, _b, _c]`
|
||||||
|
|
|
|
||||||
note: move occurs because these variables have types that don't implement the `Copy` trait
|
= note: move occurs because these variables have types that don't implement the `Copy` trait
|
||||||
--> $DIR/borrowck-vec-pattern-nesting.rs:78:15
|
|
||||||
|
|
|
||||||
LL | &mut [_a, _b, _c] => {}
|
|
||||||
| ^^ ^^ ^^
|
|
||||||
|
|
||||||
error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
|
error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice
|
||||||
--> $DIR/borrowck-vec-pattern-nesting.rs:86:13
|
--> $DIR/borrowck-vec-pattern-nesting.rs:86:13
|
||||||
|
|
|
@ -10,14 +10,7 @@ LL | => println!("one empty"),
|
||||||
LL | (&[hd1, ..], &[hd2, ..])
|
LL | (&[hd1, ..], &[hd2, ..])
|
||||||
| --- ...and here
|
| --- ...and here
|
||||||
|
|
|
|
||||||
note: move occurs because these variables have types that don't implement the `Copy` trait
|
= note: move occurs because these variables have types that don't implement the `Copy` trait
|
||||||
--> $DIR/issue-12567.rs:8:17
|
|
||||||
|
|
|
||||||
LL | (&[], &[hd, ..]) | (&[hd, ..], &[])
|
|
||||||
| ^^
|
|
||||||
LL | => println!("one empty"),
|
|
||||||
LL | (&[hd1, ..], &[hd2, ..])
|
|
||||||
| ^^^
|
|
||||||
|
|
||||||
error[E0508]: cannot move out of type `[T]`, a non-copy slice
|
error[E0508]: cannot move out of type `[T]`, a non-copy slice
|
||||||
--> $DIR/issue-12567.rs:4:11
|
--> $DIR/issue-12567.rs:4:11
|
||||||
|
@ -31,14 +24,7 @@ LL | => println!("one empty"),
|
||||||
LL | (&[hd1, ..], &[hd2, ..])
|
LL | (&[hd1, ..], &[hd2, ..])
|
||||||
| --- ...and here
|
| --- ...and here
|
||||||
|
|
|
|
||||||
note: move occurs because these variables have types that don't implement the `Copy` trait
|
= note: move occurs because these variables have types that don't implement the `Copy` trait
|
||||||
--> $DIR/issue-12567.rs:8:17
|
|
||||||
|
|
|
||||||
LL | (&[], &[hd, ..]) | (&[hd, ..], &[])
|
|
||||||
| ^^
|
|
||||||
LL | => println!("one empty"),
|
|
||||||
LL | (&[hd1, ..], &[hd2, ..])
|
|
||||||
| ^^^
|
|
||||||
|
|
||||||
error: aborting due to 2 previous errors
|
error: aborting due to 2 previous errors
|
||||||
|
|
||||||
|
|
|
@ -7,11 +7,7 @@ LL | let (a, b) = x[0];
|
||||||
| | ...and here
|
| | ...and here
|
||||||
| data moved here
|
| data moved here
|
||||||
|
|
|
|
||||||
note: move occurs because these variables have types that don't implement the `Copy` trait
|
= note: move occurs because these variables have types that don't implement the `Copy` trait
|
||||||
--> $DIR/issue-40402-2.rs:5:10
|
|
||||||
|
|
|
||||||
LL | let (a, b) = x[0];
|
|
||||||
| ^ ^
|
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -83,13 +83,7 @@ LL | B::U(d) => (),
|
||||||
LL | B::V(s) => (),
|
LL | B::V(s) => (),
|
||||||
| - ...and here
|
| - ...and here
|
||||||
|
|
|
|
||||||
note: move occurs because these variables have types that don't implement the `Copy` trait
|
= note: move occurs because these variables have types that don't implement the `Copy` trait
|
||||||
--> $DIR/move-errors.rs:76:14
|
|
||||||
|
|
|
||||||
LL | B::U(d) => (),
|
|
||||||
| ^
|
|
||||||
LL | B::V(s) => (),
|
|
||||||
| ^
|
|
||||||
|
|
||||||
error[E0509]: cannot move out of type `D`, which implements the `Drop` trait
|
error[E0509]: cannot move out of type `D`, which implements the `Drop` trait
|
||||||
--> $DIR/move-errors.rs:83:11
|
--> $DIR/move-errors.rs:83:11
|
||||||
|
@ -138,11 +132,7 @@ LL | F(s, mut t) => (),
|
||||||
| |
|
| |
|
||||||
| data moved here
|
| data moved here
|
||||||
|
|
|
|
||||||
note: move occurs because these variables have types that don't implement the `Copy` trait
|
= note: move occurs because these variables have types that don't implement the `Copy` trait
|
||||||
--> $DIR/move-errors.rs:104:11
|
|
||||||
|
|
|
||||||
LL | F(s, mut t) => (),
|
|
||||||
| ^ ^^^^^
|
|
||||||
|
|
||||||
error[E0507]: cannot move out of `x.0` which is behind a shared reference
|
error[E0507]: cannot move out of `x.0` which is behind a shared reference
|
||||||
--> $DIR/move-errors.rs:110:11
|
--> $DIR/move-errors.rs:110:11
|
||||||
|
|
|
@ -8,11 +8,7 @@ LL | let &(X(_t), X(_u)) = &(x.clone(), x.clone());
|
||||||
| | data moved here
|
| | data moved here
|
||||||
| help: consider removing the `&`: `(X(_t), X(_u))`
|
| help: consider removing the `&`: `(X(_t), X(_u))`
|
||||||
|
|
|
|
||||||
note: move occurs because these variables have types that don't implement the `Copy` trait
|
= note: move occurs because these variables have types that don't implement the `Copy` trait
|
||||||
--> $DIR/duplicate-suggestions.rs:39:13
|
|
||||||
|
|
|
||||||
LL | let &(X(_t), X(_u)) = &(x.clone(), x.clone());
|
|
||||||
| ^^ ^^
|
|
||||||
|
|
||||||
error[E0507]: cannot move out of a shared reference
|
error[E0507]: cannot move out of a shared reference
|
||||||
--> $DIR/duplicate-suggestions.rs:43:50
|
--> $DIR/duplicate-suggestions.rs:43:50
|
||||||
|
@ -24,11 +20,7 @@ LL | if let &(Either::One(_t), Either::Two(_u)) = &(e.clone(), e.clone()) {
|
||||||
| | data moved here
|
| | data moved here
|
||||||
| help: consider removing the `&`: `(Either::One(_t), Either::Two(_u))`
|
| help: consider removing the `&`: `(Either::One(_t), Either::Two(_u))`
|
||||||
|
|
|
|
||||||
note: move occurs because these variables have types that don't implement the `Copy` trait
|
= note: move occurs because these variables have types that don't implement the `Copy` trait
|
||||||
--> $DIR/duplicate-suggestions.rs:43:26
|
|
||||||
|
|
|
||||||
LL | if let &(Either::One(_t), Either::Two(_u)) = &(e.clone(), e.clone()) { }
|
|
||||||
| ^^ ^^
|
|
||||||
|
|
||||||
error[E0507]: cannot move out of a shared reference
|
error[E0507]: cannot move out of a shared reference
|
||||||
--> $DIR/duplicate-suggestions.rs:47:53
|
--> $DIR/duplicate-suggestions.rs:47:53
|
||||||
|
@ -40,11 +32,7 @@ LL | while let &(Either::One(_t), Either::Two(_u)) = &(e.clone(), e.clone())
|
||||||
| | data moved here
|
| | data moved here
|
||||||
| help: consider removing the `&`: `(Either::One(_t), Either::Two(_u))`
|
| help: consider removing the `&`: `(Either::One(_t), Either::Two(_u))`
|
||||||
|
|
|
|
||||||
note: move occurs because these variables have types that don't implement the `Copy` trait
|
= note: move occurs because these variables have types that don't implement the `Copy` trait
|
||||||
--> $DIR/duplicate-suggestions.rs:47:29
|
|
||||||
|
|
|
||||||
LL | while let &(Either::One(_t), Either::Two(_u)) = &(e.clone(), e.clone()) { }
|
|
||||||
| ^^ ^^
|
|
||||||
|
|
||||||
error[E0507]: cannot move out of a shared reference
|
error[E0507]: cannot move out of a shared reference
|
||||||
--> $DIR/duplicate-suggestions.rs:51:11
|
--> $DIR/duplicate-suggestions.rs:51:11
|
||||||
|
@ -60,14 +48,7 @@ LL | &(Either::One(_t), Either::Two(_u)) => (),
|
||||||
LL | &(Either::Two(_t), Either::One(_u)) => (),
|
LL | &(Either::Two(_t), Either::One(_u)) => (),
|
||||||
| -- ...and here -- ...and here
|
| -- ...and here -- ...and here
|
||||||
|
|
|
|
||||||
note: move occurs because these variables have types that don't implement the `Copy` trait
|
= note: move occurs because these variables have types that don't implement the `Copy` trait
|
||||||
--> $DIR/duplicate-suggestions.rs:53:23
|
|
||||||
|
|
|
||||||
LL | &(Either::One(_t), Either::Two(_u)) => (),
|
|
||||||
| ^^ ^^
|
|
||||||
...
|
|
||||||
LL | &(Either::Two(_t), Either::One(_u)) => (),
|
|
||||||
| ^^ ^^
|
|
||||||
help: consider removing the `&`
|
help: consider removing the `&`
|
||||||
|
|
|
|
||||||
LL | (Either::One(_t), Either::Two(_u)) => (),
|
LL | (Either::One(_t), Either::Two(_u)) => (),
|
||||||
|
@ -90,11 +71,7 @@ LL | &(Either::One(_t), Either::Two(_u))
|
||||||
| | data moved here
|
| | data moved here
|
||||||
| help: consider removing the `&`: `(Either::One(_t), Either::Two(_u))`
|
| help: consider removing the `&`: `(Either::One(_t), Either::Two(_u))`
|
||||||
|
|
|
|
||||||
note: move occurs because these variables have types that don't implement the `Copy` trait
|
= note: move occurs because these variables have types that don't implement the `Copy` trait
|
||||||
--> $DIR/duplicate-suggestions.rs:63:23
|
|
||||||
|
|
|
||||||
LL | &(Either::One(_t), Either::Two(_u))
|
|
||||||
| ^^ ^^
|
|
||||||
|
|
||||||
error[E0507]: cannot move out of a shared reference
|
error[E0507]: cannot move out of a shared reference
|
||||||
--> $DIR/duplicate-suggestions.rs:70:11
|
--> $DIR/duplicate-suggestions.rs:70:11
|
||||||
|
@ -109,11 +86,7 @@ LL | &(Either::One(_t), Either::Two(_u)) => (),
|
||||||
| | data moved here
|
| | data moved here
|
||||||
| help: consider removing the `&`: `(Either::One(_t), Either::Two(_u))`
|
| help: consider removing the `&`: `(Either::One(_t), Either::Two(_u))`
|
||||||
|
|
|
|
||||||
note: move occurs because these variables have types that don't implement the `Copy` trait
|
= note: move occurs because these variables have types that don't implement the `Copy` trait
|
||||||
--> $DIR/duplicate-suggestions.rs:72:23
|
|
||||||
|
|
|
||||||
LL | &(Either::One(_t), Either::Two(_u)) => (),
|
|
||||||
| ^^ ^^
|
|
||||||
|
|
||||||
error[E0507]: cannot move out of a shared reference
|
error[E0507]: cannot move out of a shared reference
|
||||||
--> $DIR/duplicate-suggestions.rs:78:11
|
--> $DIR/duplicate-suggestions.rs:78:11
|
||||||
|
@ -128,11 +101,7 @@ LL | &(Either::One(_t), Either::Two(_u)) => (),
|
||||||
| | data moved here
|
| | data moved here
|
||||||
| help: consider removing the `&`: `(Either::One(_t), Either::Two(_u))`
|
| help: consider removing the `&`: `(Either::One(_t), Either::Two(_u))`
|
||||||
|
|
|
|
||||||
note: move occurs because these variables have types that don't implement the `Copy` trait
|
= note: move occurs because these variables have types that don't implement the `Copy` trait
|
||||||
--> $DIR/duplicate-suggestions.rs:80:23
|
|
||||||
|
|
|
||||||
LL | &(Either::One(_t), Either::Two(_u)) => (),
|
|
||||||
| ^^ ^^
|
|
||||||
|
|
||||||
error[E0507]: cannot move out of a mutable reference
|
error[E0507]: cannot move out of a mutable reference
|
||||||
--> $DIR/duplicate-suggestions.rs:91:31
|
--> $DIR/duplicate-suggestions.rs:91:31
|
||||||
|
@ -144,11 +113,7 @@ LL | let &mut (X(_t), X(_u)) = &mut (xm.clone(), xm.clone());
|
||||||
| | data moved here
|
| | data moved here
|
||||||
| help: consider removing the `&mut`: `(X(_t), X(_u))`
|
| help: consider removing the `&mut`: `(X(_t), X(_u))`
|
||||||
|
|
|
|
||||||
note: move occurs because these variables have types that don't implement the `Copy` trait
|
= note: move occurs because these variables have types that don't implement the `Copy` trait
|
||||||
--> $DIR/duplicate-suggestions.rs:91:17
|
|
||||||
|
|
|
||||||
LL | let &mut (X(_t), X(_u)) = &mut (xm.clone(), xm.clone());
|
|
||||||
| ^^ ^^
|
|
||||||
|
|
||||||
error[E0507]: cannot move out of a mutable reference
|
error[E0507]: cannot move out of a mutable reference
|
||||||
--> $DIR/duplicate-suggestions.rs:95:54
|
--> $DIR/duplicate-suggestions.rs:95:54
|
||||||
|
@ -160,11 +125,7 @@ LL | if let &mut (Either::One(_t), Either::Two(_u)) = &mut (em.clone(), em.c
|
||||||
| | data moved here
|
| | data moved here
|
||||||
| help: consider removing the `&mut`: `(Either::One(_t), Either::Two(_u))`
|
| help: consider removing the `&mut`: `(Either::One(_t), Either::Two(_u))`
|
||||||
|
|
|
|
||||||
note: move occurs because these variables have types that don't implement the `Copy` trait
|
= note: move occurs because these variables have types that don't implement the `Copy` trait
|
||||||
--> $DIR/duplicate-suggestions.rs:95:30
|
|
||||||
|
|
|
||||||
LL | if let &mut (Either::One(_t), Either::Two(_u)) = &mut (em.clone(), em.clone()) { }
|
|
||||||
| ^^ ^^
|
|
||||||
|
|
||||||
error[E0507]: cannot move out of a mutable reference
|
error[E0507]: cannot move out of a mutable reference
|
||||||
--> $DIR/duplicate-suggestions.rs:99:57
|
--> $DIR/duplicate-suggestions.rs:99:57
|
||||||
|
@ -176,11 +137,7 @@ LL | while let &mut (Either::One(_t), Either::Two(_u)) = &mut (em.clone(), e
|
||||||
| | data moved here
|
| | data moved here
|
||||||
| help: consider removing the `&mut`: `(Either::One(_t), Either::Two(_u))`
|
| help: consider removing the `&mut`: `(Either::One(_t), Either::Two(_u))`
|
||||||
|
|
|
|
||||||
note: move occurs because these variables have types that don't implement the `Copy` trait
|
= note: move occurs because these variables have types that don't implement the `Copy` trait
|
||||||
--> $DIR/duplicate-suggestions.rs:99:33
|
|
||||||
|
|
|
||||||
LL | while let &mut (Either::One(_t), Either::Two(_u)) = &mut (em.clone(), em.clone()) { }
|
|
||||||
| ^^ ^^
|
|
||||||
|
|
||||||
error[E0507]: cannot move out of a mutable reference
|
error[E0507]: cannot move out of a mutable reference
|
||||||
--> $DIR/duplicate-suggestions.rs:103:11
|
--> $DIR/duplicate-suggestions.rs:103:11
|
||||||
|
@ -196,14 +153,7 @@ LL | &mut (Either::One(_t), Either::Two(_u)) => (),
|
||||||
LL | &mut (Either::Two(_t), Either::One(_u)) => (),
|
LL | &mut (Either::Two(_t), Either::One(_u)) => (),
|
||||||
| -- ...and here -- ...and here
|
| -- ...and here -- ...and here
|
||||||
|
|
|
|
||||||
note: move occurs because these variables have types that don't implement the `Copy` trait
|
= note: move occurs because these variables have types that don't implement the `Copy` trait
|
||||||
--> $DIR/duplicate-suggestions.rs:105:27
|
|
||||||
|
|
|
||||||
LL | &mut (Either::One(_t), Either::Two(_u)) => (),
|
|
||||||
| ^^ ^^
|
|
||||||
...
|
|
||||||
LL | &mut (Either::Two(_t), Either::One(_u)) => (),
|
|
||||||
| ^^ ^^
|
|
||||||
help: consider removing the `&mut`
|
help: consider removing the `&mut`
|
||||||
|
|
|
|
||||||
LL | (Either::One(_t), Either::Two(_u)) => (),
|
LL | (Either::One(_t), Either::Two(_u)) => (),
|
||||||
|
@ -226,11 +176,7 @@ LL | &mut (Either::One(_t), Either::Two(_u))
|
||||||
| | data moved here
|
| | data moved here
|
||||||
| help: consider removing the `&mut`: `(Either::One(_t), Either::Two(_u))`
|
| help: consider removing the `&mut`: `(Either::One(_t), Either::Two(_u))`
|
||||||
|
|
|
|
||||||
note: move occurs because these variables have types that don't implement the `Copy` trait
|
= note: move occurs because these variables have types that don't implement the `Copy` trait
|
||||||
--> $DIR/duplicate-suggestions.rs:115:27
|
|
||||||
|
|
|
||||||
LL | &mut (Either::One(_t), Either::Two(_u))
|
|
||||||
| ^^ ^^
|
|
||||||
|
|
||||||
error[E0507]: cannot move out of a mutable reference
|
error[E0507]: cannot move out of a mutable reference
|
||||||
--> $DIR/duplicate-suggestions.rs:122:11
|
--> $DIR/duplicate-suggestions.rs:122:11
|
||||||
|
@ -245,11 +191,7 @@ LL | &mut (Either::One(_t), Either::Two(_u)) => (),
|
||||||
| | data moved here
|
| | data moved here
|
||||||
| help: consider removing the `&mut`: `(Either::One(_t), Either::Two(_u))`
|
| help: consider removing the `&mut`: `(Either::One(_t), Either::Two(_u))`
|
||||||
|
|
|
|
||||||
note: move occurs because these variables have types that don't implement the `Copy` trait
|
= note: move occurs because these variables have types that don't implement the `Copy` trait
|
||||||
--> $DIR/duplicate-suggestions.rs:124:27
|
|
||||||
|
|
|
||||||
LL | &mut (Either::One(_t), Either::Two(_u)) => (),
|
|
||||||
| ^^ ^^
|
|
||||||
|
|
||||||
error[E0507]: cannot move out of a mutable reference
|
error[E0507]: cannot move out of a mutable reference
|
||||||
--> $DIR/duplicate-suggestions.rs:130:11
|
--> $DIR/duplicate-suggestions.rs:130:11
|
||||||
|
@ -264,11 +206,7 @@ LL | &mut (Either::One(_t), Either::Two(_u)) => (),
|
||||||
| | data moved here
|
| | data moved here
|
||||||
| help: consider removing the `&mut`: `(Either::One(_t), Either::Two(_u))`
|
| help: consider removing the `&mut`: `(Either::One(_t), Either::Two(_u))`
|
||||||
|
|
|
|
||||||
note: move occurs because these variables have types that don't implement the `Copy` trait
|
= note: move occurs because these variables have types that don't implement the `Copy` trait
|
||||||
--> $DIR/duplicate-suggestions.rs:132:27
|
|
||||||
|
|
|
||||||
LL | &mut (Either::One(_t), Either::Two(_u)) => (),
|
|
||||||
| ^^ ^^
|
|
||||||
|
|
||||||
error[E0507]: cannot move out of a mutable reference
|
error[E0507]: cannot move out of a mutable reference
|
||||||
--> $DIR/duplicate-suggestions.rs:138:11
|
--> $DIR/duplicate-suggestions.rs:138:11
|
||||||
|
@ -283,11 +221,7 @@ LL | &mut (Either::One(_t), Either::Two(_u)) => (),
|
||||||
| | data moved here
|
| | data moved here
|
||||||
| help: consider removing the `&mut`: `(Either::One(_t), Either::Two(_u))`
|
| help: consider removing the `&mut`: `(Either::One(_t), Either::Two(_u))`
|
||||||
|
|
|
|
||||||
note: move occurs because these variables have types that don't implement the `Copy` trait
|
= note: move occurs because these variables have types that don't implement the `Copy` trait
|
||||||
--> $DIR/duplicate-suggestions.rs:140:27
|
|
||||||
|
|
|
||||||
LL | &mut (Either::One(_t), Either::Two(_u)) => (),
|
|
||||||
| ^^ ^^
|
|
||||||
|
|
||||||
error[E0507]: cannot move out of a shared reference
|
error[E0507]: cannot move out of a shared reference
|
||||||
--> $DIR/duplicate-suggestions.rs:86:11
|
--> $DIR/duplicate-suggestions.rs:86:11
|
||||||
|
@ -299,11 +233,7 @@ LL | fn f5(&(X(_t), X(_u)): &(X, X)) { }
|
||||||
| | data moved here
|
| | data moved here
|
||||||
| help: consider removing the `&`: `(X(_t), X(_u))`
|
| help: consider removing the `&`: `(X(_t), X(_u))`
|
||||||
|
|
|
|
||||||
note: move occurs because these variables have types that don't implement the `Copy` trait
|
= note: move occurs because these variables have types that don't implement the `Copy` trait
|
||||||
--> $DIR/duplicate-suggestions.rs:86:15
|
|
||||||
|
|
|
||||||
LL | fn f5(&(X(_t), X(_u)): &(X, X)) { }
|
|
||||||
| ^^ ^^
|
|
||||||
|
|
||||||
error[E0507]: cannot move out of a mutable reference
|
error[E0507]: cannot move out of a mutable reference
|
||||||
--> $DIR/duplicate-suggestions.rs:146:11
|
--> $DIR/duplicate-suggestions.rs:146:11
|
||||||
|
@ -315,11 +245,7 @@ LL | fn f6(&mut (X(_t), X(_u)): &mut (X, X)) { }
|
||||||
| | data moved here
|
| | data moved here
|
||||||
| help: consider removing the `&mut`: `(X(_t), X(_u))`
|
| help: consider removing the `&mut`: `(X(_t), X(_u))`
|
||||||
|
|
|
|
||||||
note: move occurs because these variables have types that don't implement the `Copy` trait
|
= note: move occurs because these variables have types that don't implement the `Copy` trait
|
||||||
--> $DIR/duplicate-suggestions.rs:146:19
|
|
||||||
|
|
|
||||||
LL | fn f6(&mut (X(_t), X(_u)): &mut (X, X)) { }
|
|
||||||
| ^^ ^^
|
|
||||||
|
|
||||||
error: aborting due to 17 previous errors
|
error: aborting due to 17 previous errors
|
||||||
|
|
||||||
|
|
|
@ -337,14 +337,7 @@ LL | &mut Either::One(_t) => (),
|
||||||
LL | &mut Either::Two(_t) => (),
|
LL | &mut Either::Two(_t) => (),
|
||||||
| -- ...and here
|
| -- ...and here
|
||||||
|
|
|
|
||||||
note: move occurs because these variables have types that don't implement the `Copy` trait
|
= note: move occurs because these variables have types that don't implement the `Copy` trait
|
||||||
--> $DIR/simple.rs:221:26
|
|
||||||
|
|
|
||||||
LL | &mut Either::One(_t) => (),
|
|
||||||
| ^^
|
|
||||||
...
|
|
||||||
LL | &mut Either::Two(_t) => (),
|
|
||||||
| ^^
|
|
||||||
help: consider removing the `&mut`
|
help: consider removing the `&mut`
|
||||||
|
|
|
|
||||||
LL | Either::One(_t) => (),
|
LL | Either::One(_t) => (),
|
||||||
|
@ -470,13 +463,7 @@ LL | (&mut Either::One(_t),) => (),
|
||||||
LL | (&mut Either::Two(_t),) => (),
|
LL | (&mut Either::Two(_t),) => (),
|
||||||
| -- ...and here
|
| -- ...and here
|
||||||
|
|
|
|
||||||
note: move occurs because these variables have types that don't implement the `Copy` trait
|
= note: move occurs because these variables have types that don't implement the `Copy` trait
|
||||||
--> $DIR/simple.rs:280:27
|
|
||||||
|
|
|
||||||
LL | (&mut Either::One(_t),) => (),
|
|
||||||
| ^^
|
|
||||||
LL | (&mut Either::Two(_t),) => (),
|
|
||||||
| ^^
|
|
||||||
|
|
||||||
error[E0507]: cannot move out of a shared reference
|
error[E0507]: cannot move out of a shared reference
|
||||||
--> $DIR/simple.rs:288:18
|
--> $DIR/simple.rs:288:18
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue