From 0023dd9ba1f242c81042460e5ec6876bd93afdbf Mon Sep 17 00:00:00 2001 From: ashtneoi Date: Wed, 15 Aug 2018 22:36:19 -0700 Subject: [PATCH] Split tests more and bless them again --- .../dont-suggest-ref/duplicate-suggestions.rs | 162 +++++ .../duplicate-suggestions.stderr | 328 ++++++++++ .../dont-suggest-ref/move-into-closure.stderr | 84 +-- .../ui/suggestions/dont-suggest-ref/simple.rs | 114 ---- .../dont-suggest-ref/simple.stderr | 567 ++++-------------- 5 files changed, 653 insertions(+), 602 deletions(-) create mode 100644 src/test/ui/suggestions/dont-suggest-ref/duplicate-suggestions.rs create mode 100644 src/test/ui/suggestions/dont-suggest-ref/duplicate-suggestions.stderr diff --git a/src/test/ui/suggestions/dont-suggest-ref/duplicate-suggestions.rs b/src/test/ui/suggestions/dont-suggest-ref/duplicate-suggestions.rs new file mode 100644 index 00000000000..dc0186e3f26 --- /dev/null +++ b/src/test/ui/suggestions/dont-suggest-ref/duplicate-suggestions.rs @@ -0,0 +1,162 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(nll)] + +#[derive(Clone)] +enum Either { + One(X), + Two(X), +} + +#[derive(Clone)] +struct X(Y); + +#[derive(Clone)] +struct Y; + + +pub fn main() { + let e = Either::One(X(Y)); + let mut em = Either::One(X(Y)); + + let r = &e; + let rm = &mut Either::One(X(Y)); + + let x = X(Y); + let mut xm = X(Y); + + let s = &x; + let sm = &mut X(Y); + + let ve = vec![Either::One(X(Y))]; + + let vr = &ve; + let vrm = &mut vec![Either::One(X(Y))]; + + let vx = vec![X(Y)]; + + let vs = &vx; + let vsm = &mut vec![X(Y)]; + + // -------- test for duplicate suggestions -------- + + let &(X(_t), X(_u)) = &(x.clone(), x.clone()); + //~^ ERROR cannot move + //~| HELP consider removing the `&` + //~| SUGGESTION (X(_t), X(_u)) + if let &(Either::One(_t), Either::Two(_u)) = &(e.clone(), e.clone()) { } + //~^ ERROR cannot move + //~| HELP consider removing the `&` + //~| SUGGESTION (Either::One(_t), Either::Two(_u)) + while let &(Either::One(_t), Either::Two(_u)) = &(e.clone(), e.clone()) { } + //~^ ERROR cannot move + //~| HELP consider removing the `&` + //~| SUGGESTION (Either::One(_t), Either::Two(_u)) + match &(e.clone(), e.clone()) { + //~^ ERROR cannot move + &(Either::One(_t), Either::Two(_u)) => (), + //~^ HELP consider removing the `&` + //~| SUGGESTION (Either::One(_t), Either::Two(_u)) + &(Either::Two(_t), Either::One(_u)) => (), + //~^ HELP consider removing the `&` + //~| SUGGESTION (Either::Two(_t), Either::One(_u)) + _ => (), + } + match &(e.clone(), e.clone()) { + //~^ ERROR cannot move + &(Either::One(_t), Either::Two(_u)) + //~^ HELP consider removing the `&` + //~| SUGGESTION (Either::One(_t), Either::Two(_u)) + | &(Either::Two(_t), Either::One(_u)) => (), + // FIXME: would really like a suggestion here too + _ => (), + } + match &(e.clone(), e.clone()) { + //~^ ERROR cannot move + &(Either::One(_t), Either::Two(_u)) => (), + //~^ HELP consider removing the `&` + //~| SUGGESTION (Either::One(_t), Either::Two(_u)) + &(Either::Two(ref _t), Either::One(ref _u)) => (), + _ => (), + } + match &(e.clone(), e.clone()) { + //~^ ERROR cannot move + &(Either::One(_t), Either::Two(_u)) => (), + //~^ HELP consider removing the `&` + //~| SUGGESTION (Either::One(_t), Either::Two(_u)) + (Either::Two(_t), Either::One(_u)) => (), + _ => (), + } + fn f5(&(X(_t), X(_u)): &(X, X)) { } + //~^ ERROR cannot move + //~| HELP consider removing the `&` + //~| SUGGESTION (X(_t), X(_u)) + + let &mut (X(_t), X(_u)) = &mut (xm.clone(), xm.clone()); + //~^ ERROR cannot move + //~| HELP consider removing the `&mut` + //~| SUGGESTION (X(_t), X(_u)) + if let &mut (Either::One(_t), Either::Two(_u)) = &mut (em.clone(), em.clone()) { } + //~^ ERROR cannot move + //~| HELP consider removing the `&mut` + //~| SUGGESTION (Either::One(_t), Either::Two(_u)) + while let &mut (Either::One(_t), Either::Two(_u)) = &mut (em.clone(), em.clone()) { } + //~^ ERROR cannot move + //~| HELP consider removing the `&mut` + //~| SUGGESTION (Either::One(_t), Either::Two(_u)) + match &mut (em.clone(), em.clone()) { + //~^ ERROR cannot move + &mut (Either::One(_t), Either::Two(_u)) => (), + //~^ HELP consider removing the `&mut` + //~| SUGGESTION (Either::One(_t), Either::Two(_u)) + &mut (Either::Two(_t), Either::One(_u)) => (), + //~^ HELP consider removing the `&mut` + //~| SUGGESTION (Either::Two(_t), Either::One(_u)) + _ => (), + } + match &mut (em.clone(), em.clone()) { + //~^ ERROR cannot move + &mut (Either::One(_t), Either::Two(_u)) + //~^ HELP consider removing the `&mut` + //~| SUGGESTION (Either::One(_t), Either::Two(_u)) + | &mut (Either::Two(_t), Either::One(_u)) => (), + // FIXME: would really like a suggestion here too + _ => (), + } + match &mut (em.clone(), em.clone()) { + //~^ ERROR cannot move + &mut (Either::One(_t), Either::Two(_u)) => (), + //~^ HELP consider removing the `&mut` + //~| SUGGESTION (Either::One(_t), Either::Two(_u)) + &mut (Either::Two(ref _t), Either::One(ref _u)) => (), + _ => (), + } + match &mut (em.clone(), em.clone()) { + //~^ ERROR cannot move + &mut (Either::One(_t), Either::Two(_u)) => (), + //~^ HELP consider removing the `&mut` + //~| SUGGESTION (Either::One(_t), Either::Two(_u)) + &mut (Either::Two(ref mut _t), Either::One(ref mut _u)) => (), + _ => (), + } + match &mut (em.clone(), em.clone()) { + //~^ ERROR cannot move + &mut (Either::One(_t), Either::Two(_u)) => (), + //~^ HELP consider removing the `&mut` + //~| SUGGESTION (Either::One(_t), Either::Two(_u)) + (Either::Two(_t), Either::One(_u)) => (), + _ => (), + } + fn f6(&mut (X(_t), X(_u)): &mut (X, X)) { } + //~^ ERROR cannot move + //~| HELP consider removing the `&mut` + //~| SUGGESTION (X(_t), X(_u)) +} diff --git a/src/test/ui/suggestions/dont-suggest-ref/duplicate-suggestions.stderr b/src/test/ui/suggestions/dont-suggest-ref/duplicate-suggestions.stderr new file mode 100644 index 00000000000..bb3688411f7 --- /dev/null +++ b/src/test/ui/suggestions/dont-suggest-ref/duplicate-suggestions.stderr @@ -0,0 +1,328 @@ +error[E0507]: cannot move out of borrowed content + --> $DIR/duplicate-suggestions.rs:51:27 + | +LL | let &(X(_t), X(_u)) = &(x.clone(), x.clone()); + | --------------- ^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content + | | | | + | | | ...and here + | | data moved here + | help: consider removing the `&`: `(X(_t), X(_u))` + | +note: move occurs because these variables have types that don't implement the `Copy` trait + --> $DIR/duplicate-suggestions.rs:51:13 + | +LL | let &(X(_t), X(_u)) = &(x.clone(), x.clone()); + | ^^ ^^ + +error[E0507]: cannot move out of borrowed content + --> $DIR/duplicate-suggestions.rs:55:50 + | +LL | if let &(Either::One(_t), Either::Two(_u)) = &(e.clone(), e.clone()) { } + | ----------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content + | | | | + | | | ...and here + | | data moved here + | 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 + --> $DIR/duplicate-suggestions.rs:55:26 + | +LL | if let &(Either::One(_t), Either::Two(_u)) = &(e.clone(), e.clone()) { } + | ^^ ^^ + +error[E0507]: cannot move out of borrowed content + --> $DIR/duplicate-suggestions.rs:59:53 + | +LL | while let &(Either::One(_t), Either::Two(_u)) = &(e.clone(), e.clone()) { } + | ----------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content + | | | | + | | | ...and here + | | data moved here + | 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 + --> $DIR/duplicate-suggestions.rs:59:29 + | +LL | while let &(Either::One(_t), Either::Two(_u)) = &(e.clone(), e.clone()) { } + | ^^ ^^ + +error[E0507]: cannot move out of borrowed content + --> $DIR/duplicate-suggestions.rs:63:11 + | +LL | match &(e.clone(), e.clone()) { + | ^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content +LL | //~^ ERROR cannot move +LL | &(Either::One(_t), Either::Two(_u)) => (), + | -- -- ...and here + | | + | data moved here +... +LL | &(Either::Two(_t), Either::One(_u)) => (), + | -- ...and here -- ...and here + | +note: move occurs because these variables have types that don't implement the `Copy` trait + --> $DIR/duplicate-suggestions.rs:65:23 + | +LL | &(Either::One(_t), Either::Two(_u)) => (), + | ^^ ^^ +... +LL | &(Either::Two(_t), Either::One(_u)) => (), + | ^^ ^^ +help: consider removing the `&` + | +LL | (Either::One(_t), Either::Two(_u)) => (), + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +help: consider removing the `&` + | +LL | (Either::Two(_t), Either::One(_u)) => (), + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0507]: cannot move out of borrowed content + --> $DIR/duplicate-suggestions.rs:73:11 + | +LL | match &(e.clone(), e.clone()) { + | ^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content +LL | //~^ ERROR cannot move +LL | &(Either::One(_t), Either::Two(_u)) + | ----------------------------------- + | | | | + | | | ...and here + | | data moved here + | 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 + --> $DIR/duplicate-suggestions.rs:75:23 + | +LL | &(Either::One(_t), Either::Two(_u)) + | ^^ ^^ + +error[E0507]: cannot move out of borrowed content + --> $DIR/duplicate-suggestions.rs:82:11 + | +LL | match &(e.clone(), e.clone()) { + | ^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content +LL | //~^ ERROR cannot move +LL | &(Either::One(_t), Either::Two(_u)) => (), + | ----------------------------------- + | | | | + | | | ...and here + | | data moved here + | 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 + --> $DIR/duplicate-suggestions.rs:84:23 + | +LL | &(Either::One(_t), Either::Two(_u)) => (), + | ^^ ^^ + +error[E0507]: cannot move out of borrowed content + --> $DIR/duplicate-suggestions.rs:90:11 + | +LL | match &(e.clone(), e.clone()) { + | ^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content +LL | //~^ ERROR cannot move +LL | &(Either::One(_t), Either::Two(_u)) => (), + | ----------------------------------- + | | | | + | | | ...and here + | | data moved here + | 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 + --> $DIR/duplicate-suggestions.rs:92:23 + | +LL | &(Either::One(_t), Either::Two(_u)) => (), + | ^^ ^^ + +error[E0507]: cannot move out of borrowed content + --> $DIR/duplicate-suggestions.rs:103:31 + | +LL | let &mut (X(_t), X(_u)) = &mut (xm.clone(), xm.clone()); + | ------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content + | | | | + | | | ...and here + | | data moved here + | help: consider removing the `&mut`: `(X(_t), X(_u))` + | +note: move occurs because these variables have types that don't implement the `Copy` trait + --> $DIR/duplicate-suggestions.rs:103:17 + | +LL | let &mut (X(_t), X(_u)) = &mut (xm.clone(), xm.clone()); + | ^^ ^^ + +error[E0507]: cannot move out of borrowed content + --> $DIR/duplicate-suggestions.rs:107:54 + | +LL | if let &mut (Either::One(_t), Either::Two(_u)) = &mut (em.clone(), em.clone()) { } + | --------------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content + | | | | + | | | ...and here + | | data moved here + | 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 + --> $DIR/duplicate-suggestions.rs:107:30 + | +LL | if let &mut (Either::One(_t), Either::Two(_u)) = &mut (em.clone(), em.clone()) { } + | ^^ ^^ + +error[E0507]: cannot move out of borrowed content + --> $DIR/duplicate-suggestions.rs:111:57 + | +LL | while let &mut (Either::One(_t), Either::Two(_u)) = &mut (em.clone(), em.clone()) { } + | --------------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content + | | | | + | | | ...and here + | | data moved here + | 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 + --> $DIR/duplicate-suggestions.rs:111:33 + | +LL | while let &mut (Either::One(_t), Either::Two(_u)) = &mut (em.clone(), em.clone()) { } + | ^^ ^^ + +error[E0507]: cannot move out of borrowed content + --> $DIR/duplicate-suggestions.rs:115:11 + | +LL | match &mut (em.clone(), em.clone()) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content +LL | //~^ ERROR cannot move +LL | &mut (Either::One(_t), Either::Two(_u)) => (), + | -- -- ...and here + | | + | data moved here +... +LL | &mut (Either::Two(_t), Either::One(_u)) => (), + | -- ...and here -- ...and here + | +note: move occurs because these variables have types that don't implement the `Copy` trait + --> $DIR/duplicate-suggestions.rs:117:27 + | +LL | &mut (Either::One(_t), Either::Two(_u)) => (), + | ^^ ^^ +... +LL | &mut (Either::Two(_t), Either::One(_u)) => (), + | ^^ ^^ +help: consider removing the `&mut` + | +LL | (Either::One(_t), Either::Two(_u)) => (), + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +help: consider removing the `&mut` + | +LL | (Either::Two(_t), Either::One(_u)) => (), + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0507]: cannot move out of borrowed content + --> $DIR/duplicate-suggestions.rs:125:11 + | +LL | match &mut (em.clone(), em.clone()) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content +LL | //~^ ERROR cannot move +LL | &mut (Either::One(_t), Either::Two(_u)) + | --------------------------------------- + | | | | + | | | ...and here + | | data moved here + | 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 + --> $DIR/duplicate-suggestions.rs:127:27 + | +LL | &mut (Either::One(_t), Either::Two(_u)) + | ^^ ^^ + +error[E0507]: cannot move out of borrowed content + --> $DIR/duplicate-suggestions.rs:134:11 + | +LL | match &mut (em.clone(), em.clone()) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content +LL | //~^ ERROR cannot move +LL | &mut (Either::One(_t), Either::Two(_u)) => (), + | --------------------------------------- + | | | | + | | | ...and here + | | data moved here + | 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 + --> $DIR/duplicate-suggestions.rs:136:27 + | +LL | &mut (Either::One(_t), Either::Two(_u)) => (), + | ^^ ^^ + +error[E0507]: cannot move out of borrowed content + --> $DIR/duplicate-suggestions.rs:142:11 + | +LL | match &mut (em.clone(), em.clone()) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content +LL | //~^ ERROR cannot move +LL | &mut (Either::One(_t), Either::Two(_u)) => (), + | --------------------------------------- + | | | | + | | | ...and here + | | data moved here + | 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 + --> $DIR/duplicate-suggestions.rs:144:27 + | +LL | &mut (Either::One(_t), Either::Two(_u)) => (), + | ^^ ^^ + +error[E0507]: cannot move out of borrowed content + --> $DIR/duplicate-suggestions.rs:150:11 + | +LL | match &mut (em.clone(), em.clone()) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content +LL | //~^ ERROR cannot move +LL | &mut (Either::One(_t), Either::Two(_u)) => (), + | --------------------------------------- + | | | | + | | | ...and here + | | data moved here + | 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 + --> $DIR/duplicate-suggestions.rs:152:27 + | +LL | &mut (Either::One(_t), Either::Two(_u)) => (), + | ^^ ^^ + +error[E0507]: cannot move out of borrowed content + --> $DIR/duplicate-suggestions.rs:98:11 + | +LL | fn f5(&(X(_t), X(_u)): &(X, X)) { } + | ^^^^--^^^^^--^^ + | | | | + | | | ...and here + | | data moved here + | cannot move out of borrowed content + | help: consider removing the `&`: `(X(_t), X(_u))` + | +note: move occurs because these variables have types that don't implement the `Copy` trait + --> $DIR/duplicate-suggestions.rs:98:15 + | +LL | fn f5(&(X(_t), X(_u)): &(X, X)) { } + | ^^ ^^ + +error[E0507]: cannot move out of borrowed content + --> $DIR/duplicate-suggestions.rs:158:11 + | +LL | fn f6(&mut (X(_t), X(_u)): &mut (X, X)) { } + | ^^^^^^^^--^^^^^--^^ + | | | | + | | | ...and here + | | data moved here + | cannot move out of borrowed content + | help: consider removing the `&mut`: `(X(_t), X(_u))` + | +note: move occurs because these variables have types that don't implement the `Copy` trait + --> $DIR/duplicate-suggestions.rs:158:19 + | +LL | fn f6(&mut (X(_t), X(_u)): &mut (X, X)) { } + | ^^ ^^ + +error: aborting due to 17 previous errors + +For more information about this error, try `rustc --explain E0507`. diff --git a/src/test/ui/suggestions/dont-suggest-ref/move-into-closure.stderr b/src/test/ui/suggestions/dont-suggest-ref/move-into-closure.stderr index 825676b5fdf..228ec5afce6 100644 --- a/src/test/ui/suggestions/dont-suggest-ref/move-into-closure.stderr +++ b/src/test/ui/suggestions/dont-suggest-ref/move-into-closure.stderr @@ -1,5 +1,5 @@ error[E0507]: cannot move out of captured variable in an `Fn` closure - --> $DIR/dont-suggest-ref-in-closure.rs:40:21 + --> $DIR/move-into-closure.rs:40:21 | LL | let x = X(Y); | - captured outer variable @@ -12,13 +12,13 @@ LL | let X(_t) = x; | data moved here | note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref-in-closure.rs:40:15 + --> $DIR/move-into-closure.rs:40:15 | LL | let X(_t) = x; | ^^ error[E0507]: cannot move out of captured variable in an `Fn` closure - --> $DIR/dont-suggest-ref-in-closure.rs:44:34 + --> $DIR/move-into-closure.rs:44:34 | LL | let e = Either::One(X(Y)); | - captured outer variable @@ -31,13 +31,13 @@ LL | if let Either::One(_t) = e { } | data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref-in-closure.rs:44:28 + --> $DIR/move-into-closure.rs:44:28 | LL | if let Either::One(_t) = e { } | ^^ error[E0507]: cannot move out of captured variable in an `Fn` closure - --> $DIR/dont-suggest-ref-in-closure.rs:48:37 + --> $DIR/move-into-closure.rs:48:37 | LL | let e = Either::One(X(Y)); | - captured outer variable @@ -50,13 +50,13 @@ LL | while let Either::One(_t) = e { } | data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref-in-closure.rs:48:31 + --> $DIR/move-into-closure.rs:48:31 | LL | while let Either::One(_t) = e { } | ^^ error[E0507]: cannot move out of captured variable in an `Fn` closure - --> $DIR/dont-suggest-ref-in-closure.rs:52:15 + --> $DIR/move-into-closure.rs:52:15 | LL | let e = Either::One(X(Y)); | - captured outer variable @@ -71,13 +71,13 @@ LL | Either::One(_t) | -- data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref-in-closure.rs:56:25 + --> $DIR/move-into-closure.rs:56:25 | LL | Either::One(_t) | ^^ error[E0507]: cannot move out of captured variable in an `Fn` closure - --> $DIR/dont-suggest-ref-in-closure.rs:59:15 + --> $DIR/move-into-closure.rs:59:15 | LL | let e = Either::One(X(Y)); | - captured outer variable @@ -92,13 +92,13 @@ LL | Either::One(_t) => (), | -- data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref-in-closure.rs:63:25 + --> $DIR/move-into-closure.rs:63:25 | LL | Either::One(_t) => (), | ^^ error[E0507]: cannot move out of captured variable in an `Fn` closure - --> $DIR/dont-suggest-ref-in-closure.rs:68:25 + --> $DIR/move-into-closure.rs:68:25 | LL | let x = X(Y); | - captured outer variable @@ -111,13 +111,13 @@ LL | let X(mut _t) = x; | data moved here | note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref-in-closure.rs:68:15 + --> $DIR/move-into-closure.rs:68:15 | LL | let X(mut _t) = x; | ^^^^^^ error[E0507]: cannot move out of captured variable in an `Fn` closure - --> $DIR/dont-suggest-ref-in-closure.rs:72:38 + --> $DIR/move-into-closure.rs:72:38 | LL | let mut em = Either::One(X(Y)); | ------ captured outer variable @@ -130,13 +130,13 @@ LL | if let Either::One(mut _t) = em { } | data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref-in-closure.rs:72:28 + --> $DIR/move-into-closure.rs:72:28 | LL | if let Either::One(mut _t) = em { } | ^^^^^^ error[E0507]: cannot move out of captured variable in an `Fn` closure - --> $DIR/dont-suggest-ref-in-closure.rs:76:41 + --> $DIR/move-into-closure.rs:76:41 | LL | let mut em = Either::One(X(Y)); | ------ captured outer variable @@ -149,13 +149,13 @@ LL | while let Either::One(mut _t) = em { } | data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref-in-closure.rs:76:31 + --> $DIR/move-into-closure.rs:76:31 | LL | while let Either::One(mut _t) = em { } | ^^^^^^ error[E0507]: cannot move out of captured variable in an `Fn` closure - --> $DIR/dont-suggest-ref-in-closure.rs:80:15 + --> $DIR/move-into-closure.rs:80:15 | LL | let mut em = Either::One(X(Y)); | ------ captured outer variable @@ -170,13 +170,13 @@ LL | Either::One(mut _t) | ------ data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref-in-closure.rs:84:25 + --> $DIR/move-into-closure.rs:84:25 | LL | Either::One(mut _t) | ^^^^^^ error[E0507]: cannot move out of captured variable in an `Fn` closure - --> $DIR/dont-suggest-ref-in-closure.rs:87:15 + --> $DIR/move-into-closure.rs:87:15 | LL | let mut em = Either::One(X(Y)); | ------ captured outer variable @@ -191,13 +191,13 @@ LL | Either::One(mut _t) => (), | ------ data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref-in-closure.rs:91:25 + --> $DIR/move-into-closure.rs:91:25 | LL | Either::One(mut _t) => (), | ^^^^^^ error[E0507]: cannot move out of captured variable in an `FnMut` closure - --> $DIR/dont-suggest-ref-in-closure.rs:107:21 + --> $DIR/move-into-closure.rs:107:21 | LL | let x = X(Y); | - captured outer variable @@ -210,13 +210,13 @@ LL | let X(_t) = x; | data moved here | note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref-in-closure.rs:107:15 + --> $DIR/move-into-closure.rs:107:15 | LL | let X(_t) = x; | ^^ error[E0507]: cannot move out of captured variable in an `FnMut` closure - --> $DIR/dont-suggest-ref-in-closure.rs:111:34 + --> $DIR/move-into-closure.rs:111:34 | LL | let e = Either::One(X(Y)); | - captured outer variable @@ -229,13 +229,13 @@ LL | if let Either::One(_t) = e { } | data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref-in-closure.rs:111:28 + --> $DIR/move-into-closure.rs:111:28 | LL | if let Either::One(_t) = e { } | ^^ error[E0507]: cannot move out of captured variable in an `FnMut` closure - --> $DIR/dont-suggest-ref-in-closure.rs:115:37 + --> $DIR/move-into-closure.rs:115:37 | LL | let e = Either::One(X(Y)); | - captured outer variable @@ -248,13 +248,13 @@ LL | while let Either::One(_t) = e { } | data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref-in-closure.rs:115:31 + --> $DIR/move-into-closure.rs:115:31 | LL | while let Either::One(_t) = e { } | ^^ error[E0507]: cannot move out of captured variable in an `FnMut` closure - --> $DIR/dont-suggest-ref-in-closure.rs:119:15 + --> $DIR/move-into-closure.rs:119:15 | LL | let e = Either::One(X(Y)); | - captured outer variable @@ -269,13 +269,13 @@ LL | Either::One(_t) | -- data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref-in-closure.rs:123:25 + --> $DIR/move-into-closure.rs:123:25 | LL | Either::One(_t) | ^^ error[E0507]: cannot move out of captured variable in an `FnMut` closure - --> $DIR/dont-suggest-ref-in-closure.rs:126:15 + --> $DIR/move-into-closure.rs:126:15 | LL | let e = Either::One(X(Y)); | - captured outer variable @@ -290,13 +290,13 @@ LL | Either::One(_t) => (), | -- data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref-in-closure.rs:130:25 + --> $DIR/move-into-closure.rs:130:25 | LL | Either::One(_t) => (), | ^^ error[E0507]: cannot move out of captured variable in an `FnMut` closure - --> $DIR/dont-suggest-ref-in-closure.rs:135:25 + --> $DIR/move-into-closure.rs:135:25 | LL | let x = X(Y); | - captured outer variable @@ -309,13 +309,13 @@ LL | let X(mut _t) = x; | data moved here | note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref-in-closure.rs:135:15 + --> $DIR/move-into-closure.rs:135:15 | LL | let X(mut _t) = x; | ^^^^^^ error[E0507]: cannot move out of captured variable in an `FnMut` closure - --> $DIR/dont-suggest-ref-in-closure.rs:139:38 + --> $DIR/move-into-closure.rs:139:38 | LL | let mut em = Either::One(X(Y)); | ------ captured outer variable @@ -328,13 +328,13 @@ LL | if let Either::One(mut _t) = em { } | data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref-in-closure.rs:139:28 + --> $DIR/move-into-closure.rs:139:28 | LL | if let Either::One(mut _t) = em { } | ^^^^^^ error[E0507]: cannot move out of captured variable in an `FnMut` closure - --> $DIR/dont-suggest-ref-in-closure.rs:143:41 + --> $DIR/move-into-closure.rs:143:41 | LL | let mut em = Either::One(X(Y)); | ------ captured outer variable @@ -347,13 +347,13 @@ LL | while let Either::One(mut _t) = em { } | data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref-in-closure.rs:143:31 + --> $DIR/move-into-closure.rs:143:31 | LL | while let Either::One(mut _t) = em { } | ^^^^^^ error[E0507]: cannot move out of captured variable in an `FnMut` closure - --> $DIR/dont-suggest-ref-in-closure.rs:147:15 + --> $DIR/move-into-closure.rs:147:15 | LL | let mut em = Either::One(X(Y)); | ------ captured outer variable @@ -368,13 +368,13 @@ LL | Either::One(mut _t) | ------ data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref-in-closure.rs:151:25 + --> $DIR/move-into-closure.rs:151:25 | LL | Either::One(mut _t) | ^^^^^^ error[E0507]: cannot move out of captured variable in an `FnMut` closure - --> $DIR/dont-suggest-ref-in-closure.rs:154:15 + --> $DIR/move-into-closure.rs:154:15 | LL | let mut em = Either::One(X(Y)); | ------ captured outer variable @@ -389,13 +389,13 @@ LL | Either::One(mut _t) => (), | ------ data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref-in-closure.rs:158:25 + --> $DIR/move-into-closure.rs:158:25 | LL | Either::One(mut _t) => (), | ^^^^^^ error[E0507]: cannot move out of captured variable in an `FnMut` closure - --> $DIR/dont-suggest-ref-in-closure.rs:162:15 + --> $DIR/move-into-closure.rs:162:15 | LL | let mut em = Either::One(X(Y)); | ------ captured outer variable @@ -410,7 +410,7 @@ LL | Either::One(mut _t) => (), | ------ data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref-in-closure.rs:166:25 + --> $DIR/move-into-closure.rs:166:25 | LL | Either::One(mut _t) => (), | ^^^^^^ diff --git a/src/test/ui/suggestions/dont-suggest-ref/simple.rs b/src/test/ui/suggestions/dont-suggest-ref/simple.rs index 3bd6102c5d6..474e88c4d53 100644 --- a/src/test/ui/suggestions/dont-suggest-ref/simple.rs +++ b/src/test/ui/suggestions/dont-suggest-ref/simple.rs @@ -373,118 +373,4 @@ pub fn main() { //~| SUGGESTION Either::One(_t) Either::Two(_t) => (), } - - // -------- test for duplicate suggestions -------- - - let &(X(_t), X(_u)) = &(x.clone(), x.clone()); - //~^ ERROR cannot move - //~| HELP consider removing the `&` - //~| SUGGESTION (X(_t), X(_u)) - if let &(Either::One(_t), Either::Two(_u)) = &(e.clone(), e.clone()) { } - //~^ ERROR cannot move - //~| HELP consider removing the `&` - //~| SUGGESTION (Either::One(_t), Either::Two(_u)) - while let &(Either::One(_t), Either::Two(_u)) = &(e.clone(), e.clone()) { } - //~^ ERROR cannot move - //~| HELP consider removing the `&` - //~| SUGGESTION (Either::One(_t), Either::Two(_u)) - match &(e.clone(), e.clone()) { - //~^ ERROR cannot move - &(Either::One(_t), Either::Two(_u)) => (), - //~^ HELP consider removing the `&` - //~| SUGGESTION (Either::One(_t), Either::Two(_u)) - &(Either::Two(_t), Either::One(_u)) => (), - //~^ HELP consider removing the `&` - //~| SUGGESTION (Either::Two(_t), Either::One(_u)) - _ => (), - } - match &(e.clone(), e.clone()) { - //~^ ERROR cannot move - &(Either::One(_t), Either::Two(_u)) - //~^ HELP consider removing the `&` - //~| SUGGESTION (Either::One(_t), Either::Two(_u)) - | &(Either::Two(_t), Either::One(_u)) => (), - // FIXME: would really like a suggestion here too - _ => (), - } - match &(e.clone(), e.clone()) { - //~^ ERROR cannot move - &(Either::One(_t), Either::Two(_u)) => (), - //~^ HELP consider removing the `&` - //~| SUGGESTION (Either::One(_t), Either::Two(_u)) - &(Either::Two(ref _t), Either::One(ref _u)) => (), - _ => (), - } - match &(e.clone(), e.clone()) { - //~^ ERROR cannot move - &(Either::One(_t), Either::Two(_u)) => (), - //~^ HELP consider removing the `&` - //~| SUGGESTION (Either::One(_t), Either::Two(_u)) - (Either::Two(_t), Either::One(_u)) => (), - _ => (), - } - fn f5(&(X(_t), X(_u)): &(X, X)) { } - //~^ ERROR cannot move - //~| HELP consider removing the `&` - //~| SUGGESTION (X(_t), X(_u)) - - let &mut (X(_t), X(_u)) = &mut (xm.clone(), xm.clone()); - //~^ ERROR cannot move - //~| HELP consider removing the `&mut` - //~| SUGGESTION (X(_t), X(_u)) - if let &mut (Either::One(_t), Either::Two(_u)) = &mut (em.clone(), em.clone()) { } - //~^ ERROR cannot move - //~| HELP consider removing the `&mut` - //~| SUGGESTION (Either::One(_t), Either::Two(_u)) - while let &mut (Either::One(_t), Either::Two(_u)) = &mut (em.clone(), em.clone()) { } - //~^ ERROR cannot move - //~| HELP consider removing the `&mut` - //~| SUGGESTION (Either::One(_t), Either::Two(_u)) - match &mut (em.clone(), em.clone()) { - //~^ ERROR cannot move - &mut (Either::One(_t), Either::Two(_u)) => (), - //~^ HELP consider removing the `&mut` - //~| SUGGESTION (Either::One(_t), Either::Two(_u)) - &mut (Either::Two(_t), Either::One(_u)) => (), - //~^ HELP consider removing the `&mut` - //~| SUGGESTION (Either::Two(_t), Either::One(_u)) - _ => (), - } - match &mut (em.clone(), em.clone()) { - //~^ ERROR cannot move - &mut (Either::One(_t), Either::Two(_u)) - //~^ HELP consider removing the `&mut` - //~| SUGGESTION (Either::One(_t), Either::Two(_u)) - | &mut (Either::Two(_t), Either::One(_u)) => (), - // FIXME: would really like a suggestion here too - _ => (), - } - match &mut (em.clone(), em.clone()) { - //~^ ERROR cannot move - &mut (Either::One(_t), Either::Two(_u)) => (), - //~^ HELP consider removing the `&mut` - //~| SUGGESTION (Either::One(_t), Either::Two(_u)) - &mut (Either::Two(ref _t), Either::One(ref _u)) => (), - _ => (), - } - match &mut (em.clone(), em.clone()) { - //~^ ERROR cannot move - &mut (Either::One(_t), Either::Two(_u)) => (), - //~^ HELP consider removing the `&mut` - //~| SUGGESTION (Either::One(_t), Either::Two(_u)) - &mut (Either::Two(ref mut _t), Either::One(ref mut _u)) => (), - _ => (), - } - match &mut (em.clone(), em.clone()) { - //~^ ERROR cannot move - &mut (Either::One(_t), Either::Two(_u)) => (), - //~^ HELP consider removing the `&mut` - //~| SUGGESTION (Either::One(_t), Either::Two(_u)) - (Either::Two(_t), Either::One(_u)) => (), - _ => (), - } - fn f6(&mut (X(_t), X(_u)): &mut (X, X)) { } - //~^ ERROR cannot move - //~| HELP consider removing the `&mut` - //~| SUGGESTION (X(_t), X(_u)) } diff --git a/src/test/ui/suggestions/dont-suggest-ref/simple.stderr b/src/test/ui/suggestions/dont-suggest-ref/simple.stderr index 8994152d1a5..d7a32dbfcc6 100644 --- a/src/test/ui/suggestions/dont-suggest-ref/simple.stderr +++ b/src/test/ui/suggestions/dont-suggest-ref/simple.stderr @@ -1,5 +1,5 @@ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:50:17 + --> $DIR/simple.rs:50:17 | LL | let X(_t) = *s; | -- ^^ @@ -9,13 +9,13 @@ LL | let X(_t) = *s; | data moved here | note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:50:11 + --> $DIR/simple.rs:50:11 | LL | let X(_t) = *s; | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:54:30 + --> $DIR/simple.rs:54:30 | LL | if let Either::One(_t) = *r { } | -- ^^ @@ -25,13 +25,13 @@ LL | if let Either::One(_t) = *r { } | data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:54:24 + --> $DIR/simple.rs:54:24 | LL | if let Either::One(_t) = *r { } | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:58:33 + --> $DIR/simple.rs:58:33 | LL | while let Either::One(_t) = *r { } | -- ^^ @@ -41,13 +41,13 @@ LL | while let Either::One(_t) = *r { } | data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:58:27 + --> $DIR/simple.rs:58:27 | LL | while let Either::One(_t) = *r { } | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:62:11 + --> $DIR/simple.rs:62:11 | LL | match *r { | ^^ @@ -59,13 +59,13 @@ LL | Either::One(_t) | -- data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:66:21 + --> $DIR/simple.rs:66:21 | LL | Either::One(_t) | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:69:11 + --> $DIR/simple.rs:69:11 | LL | match *r { | ^^ @@ -77,13 +77,13 @@ LL | Either::One(_t) => (), | -- data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:73:21 + --> $DIR/simple.rs:73:21 | LL | Either::One(_t) => (), | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:78:17 + --> $DIR/simple.rs:78:17 | LL | let X(_t) = *sm; | -- ^^^ @@ -93,13 +93,13 @@ LL | let X(_t) = *sm; | data moved here | note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:78:11 + --> $DIR/simple.rs:78:11 | LL | let X(_t) = *sm; | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:82:30 + --> $DIR/simple.rs:82:30 | LL | if let Either::One(_t) = *rm { } | -- ^^^ @@ -109,13 +109,13 @@ LL | if let Either::One(_t) = *rm { } | data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:82:24 + --> $DIR/simple.rs:82:24 | LL | if let Either::One(_t) = *rm { } | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:86:33 + --> $DIR/simple.rs:86:33 | LL | while let Either::One(_t) = *rm { } | -- ^^^ @@ -125,13 +125,13 @@ LL | while let Either::One(_t) = *rm { } | data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:86:27 + --> $DIR/simple.rs:86:27 | LL | while let Either::One(_t) = *rm { } | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:90:11 + --> $DIR/simple.rs:90:11 | LL | match *rm { | ^^^ @@ -143,13 +143,13 @@ LL | Either::One(_t) | -- data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:94:21 + --> $DIR/simple.rs:94:21 | LL | Either::One(_t) | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:97:11 + --> $DIR/simple.rs:97:11 | LL | match *rm { | ^^^ @@ -161,13 +161,13 @@ LL | Either::One(_t) => (), | -- data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:101:21 + --> $DIR/simple.rs:101:21 | LL | Either::One(_t) => (), | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:105:11 + --> $DIR/simple.rs:105:11 | LL | match *rm { | ^^^ @@ -179,13 +179,13 @@ LL | Either::One(_t) => (), | -- data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:109:21 + --> $DIR/simple.rs:109:21 | LL | Either::One(_t) => (), | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:114:17 + --> $DIR/simple.rs:114:17 | LL | let X(_t) = vs[0]; | -- ^^^^^ @@ -195,13 +195,13 @@ LL | let X(_t) = vs[0]; | data moved here | note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:114:11 + --> $DIR/simple.rs:114:11 | LL | let X(_t) = vs[0]; | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:118:30 + --> $DIR/simple.rs:118:30 | LL | if let Either::One(_t) = vr[0] { } | -- ^^^^^ @@ -211,13 +211,13 @@ LL | if let Either::One(_t) = vr[0] { } | data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:118:24 + --> $DIR/simple.rs:118:24 | LL | if let Either::One(_t) = vr[0] { } | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:122:33 + --> $DIR/simple.rs:122:33 | LL | while let Either::One(_t) = vr[0] { } | -- ^^^^^ @@ -227,13 +227,13 @@ LL | while let Either::One(_t) = vr[0] { } | data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:122:27 + --> $DIR/simple.rs:122:27 | LL | while let Either::One(_t) = vr[0] { } | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:126:11 + --> $DIR/simple.rs:126:11 | LL | match vr[0] { | ^^^^^ @@ -245,13 +245,13 @@ LL | Either::One(_t) | -- data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:130:21 + --> $DIR/simple.rs:130:21 | LL | Either::One(_t) | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:133:11 + --> $DIR/simple.rs:133:11 | LL | match vr[0] { | ^^^^^ @@ -263,13 +263,13 @@ LL | Either::One(_t) => (), | -- data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:137:21 + --> $DIR/simple.rs:137:21 | LL | Either::One(_t) => (), | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:142:17 + --> $DIR/simple.rs:142:17 | LL | let X(_t) = vsm[0]; | -- ^^^^^^ @@ -279,13 +279,13 @@ LL | let X(_t) = vsm[0]; | data moved here | note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:142:11 + --> $DIR/simple.rs:142:11 | LL | let X(_t) = vsm[0]; | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:146:30 + --> $DIR/simple.rs:146:30 | LL | if let Either::One(_t) = vrm[0] { } | -- ^^^^^^ @@ -295,13 +295,13 @@ LL | if let Either::One(_t) = vrm[0] { } | data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:146:24 + --> $DIR/simple.rs:146:24 | LL | if let Either::One(_t) = vrm[0] { } | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:150:33 + --> $DIR/simple.rs:150:33 | LL | while let Either::One(_t) = vrm[0] { } | -- ^^^^^^ @@ -311,13 +311,13 @@ LL | while let Either::One(_t) = vrm[0] { } | data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:150:27 + --> $DIR/simple.rs:150:27 | LL | while let Either::One(_t) = vrm[0] { } | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:154:11 + --> $DIR/simple.rs:154:11 | LL | match vrm[0] { | ^^^^^^ @@ -329,13 +329,13 @@ LL | Either::One(_t) | -- data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:158:21 + --> $DIR/simple.rs:158:21 | LL | Either::One(_t) | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:161:11 + --> $DIR/simple.rs:161:11 | LL | match vrm[0] { | ^^^^^^ @@ -347,13 +347,13 @@ LL | Either::One(_t) => (), | -- data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:165:21 + --> $DIR/simple.rs:165:21 | LL | Either::One(_t) => (), | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:169:11 + --> $DIR/simple.rs:169:11 | LL | match vrm[0] { | ^^^^^^ @@ -365,13 +365,13 @@ LL | Either::One(_t) => (), | -- data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:173:21 + --> $DIR/simple.rs:173:21 | LL | Either::One(_t) => (), | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:180:18 + --> $DIR/simple.rs:180:18 | LL | let &X(_t) = s; | ------ ^ cannot move out of borrowed content @@ -380,13 +380,13 @@ LL | let &X(_t) = s; | help: consider removing the `&`: `X(_t)` | note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:180:12 + --> $DIR/simple.rs:180:12 | LL | let &X(_t) = s; | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:184:31 + --> $DIR/simple.rs:184:31 | LL | if let &Either::One(_t) = r { } | ---------------- ^ cannot move out of borrowed content @@ -395,13 +395,13 @@ LL | if let &Either::One(_t) = r { } | help: consider removing the `&`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:184:25 + --> $DIR/simple.rs:184:25 | LL | if let &Either::One(_t) = r { } | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:188:34 + --> $DIR/simple.rs:188:34 | LL | while let &Either::One(_t) = r { } | ---------------- ^ cannot move out of borrowed content @@ -410,13 +410,13 @@ LL | while let &Either::One(_t) = r { } | help: consider removing the `&`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:188:28 + --> $DIR/simple.rs:188:28 | LL | while let &Either::One(_t) = r { } | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:192:11 + --> $DIR/simple.rs:192:11 | LL | match r { | ^ cannot move out of borrowed content @@ -428,13 +428,13 @@ LL | &Either::One(_t) | help: consider removing the `&`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:194:22 + --> $DIR/simple.rs:194:22 | LL | &Either::One(_t) | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:200:11 + --> $DIR/simple.rs:200:11 | LL | match r { | ^ cannot move out of borrowed content @@ -446,13 +446,13 @@ LL | &Either::One(_t) => (), | help: consider removing the `&`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:202:22 + --> $DIR/simple.rs:202:22 | LL | &Either::One(_t) => (), | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:207:11 + --> $DIR/simple.rs:207:11 | LL | match r { | ^ cannot move out of borrowed content @@ -464,13 +464,13 @@ LL | &Either::One(_t) => (), | help: consider removing the `&`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:209:22 + --> $DIR/simple.rs:209:22 | LL | &Either::One(_t) => (), | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:219:22 + --> $DIR/simple.rs:219:22 | LL | let &mut X(_t) = sm; | ---------- ^^ cannot move out of borrowed content @@ -479,13 +479,13 @@ LL | let &mut X(_t) = sm; | help: consider removing the `&mut`: `X(_t)` | note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:219:16 + --> $DIR/simple.rs:219:16 | LL | let &mut X(_t) = sm; | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:223:35 + --> $DIR/simple.rs:223:35 | LL | if let &mut Either::One(_t) = rm { } | -------------------- ^^ cannot move out of borrowed content @@ -494,13 +494,13 @@ LL | if let &mut Either::One(_t) = rm { } | help: consider removing the `&mut`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:223:29 + --> $DIR/simple.rs:223:29 | LL | if let &mut Either::One(_t) = rm { } | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:227:38 + --> $DIR/simple.rs:227:38 | LL | while let &mut Either::One(_t) = rm { } | -------------------- ^^ cannot move out of borrowed content @@ -509,13 +509,13 @@ LL | while let &mut Either::One(_t) = rm { } | help: consider removing the `&mut`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:227:32 + --> $DIR/simple.rs:227:32 | LL | while let &mut Either::One(_t) = rm { } | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:231:11 + --> $DIR/simple.rs:231:11 | LL | match rm { | ^^ cannot move out of borrowed content @@ -527,7 +527,7 @@ LL | &mut Either::Two(_t) => (), | -- ...and here | note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:233:26 + --> $DIR/simple.rs:233:26 | LL | &mut Either::One(_t) => (), | ^^ @@ -544,7 +544,7 @@ LL | Either::Two(_t) => (), | ^^^^^^^^^^^^^^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:240:11 + --> $DIR/simple.rs:240:11 | LL | match rm { | ^^ cannot move out of borrowed content @@ -556,13 +556,13 @@ LL | &mut Either::One(_t) => (), | help: consider removing the `&mut`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:242:26 + --> $DIR/simple.rs:242:26 | LL | &mut Either::One(_t) => (), | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:247:11 + --> $DIR/simple.rs:247:11 | LL | match rm { | ^^ cannot move out of borrowed content @@ -574,13 +574,13 @@ LL | &mut Either::One(_t) => (), | help: consider removing the `&mut`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:249:26 + --> $DIR/simple.rs:249:26 | LL | &mut Either::One(_t) => (), | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:254:11 + --> $DIR/simple.rs:254:11 | LL | match rm { | ^^ cannot move out of borrowed content @@ -592,13 +592,13 @@ LL | &mut Either::One(_t) => (), | help: consider removing the `&mut`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:256:26 + --> $DIR/simple.rs:256:26 | LL | &mut Either::One(_t) => (), | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:270:21 + --> $DIR/simple.rs:270:21 | LL | let (&X(_t),) = (&x.clone(),); | -- ^^^^^^^^^^^^^ cannot move out of borrowed content @@ -606,13 +606,13 @@ LL | let (&X(_t),) = (&x.clone(),); | data moved here | note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:270:13 + --> $DIR/simple.rs:270:13 | LL | let (&X(_t),) = (&x.clone(),); | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:272:34 + --> $DIR/simple.rs:272:34 | LL | if let (&Either::One(_t),) = (&e.clone(),) { } | -- ^^^^^^^^^^^^^ cannot move out of borrowed content @@ -620,13 +620,13 @@ LL | if let (&Either::One(_t),) = (&e.clone(),) { } | data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:272:26 + --> $DIR/simple.rs:272:26 | LL | if let (&Either::One(_t),) = (&e.clone(),) { } | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:274:37 + --> $DIR/simple.rs:274:37 | LL | while let (&Either::One(_t),) = (&e.clone(),) { } | -- ^^^^^^^^^^^^^ cannot move out of borrowed content @@ -634,13 +634,13 @@ LL | while let (&Either::One(_t),) = (&e.clone(),) { } | data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:274:29 + --> $DIR/simple.rs:274:29 | LL | while let (&Either::One(_t),) = (&e.clone(),) { } | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:276:11 + --> $DIR/simple.rs:276:11 | LL | match (&e.clone(),) { | ^^^^^^^^^^^^^ cannot move out of borrowed content @@ -649,13 +649,13 @@ LL | (&Either::One(_t),) | -- data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:278:23 + --> $DIR/simple.rs:278:23 | LL | (&Either::One(_t),) | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:284:25 + --> $DIR/simple.rs:284:25 | LL | let (&mut X(_t),) = (&mut xm.clone(),); | -- ^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content @@ -663,13 +663,13 @@ LL | let (&mut X(_t),) = (&mut xm.clone(),); | data moved here | note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:284:17 + --> $DIR/simple.rs:284:17 | LL | let (&mut X(_t),) = (&mut xm.clone(),); | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:286:38 + --> $DIR/simple.rs:286:38 | LL | if let (&mut Either::One(_t),) = (&mut em.clone(),) { } | -- ^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content @@ -677,13 +677,13 @@ LL | if let (&mut Either::One(_t),) = (&mut em.clone(),) { } | data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:286:30 + --> $DIR/simple.rs:286:30 | LL | if let (&mut Either::One(_t),) = (&mut em.clone(),) { } | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:288:41 + --> $DIR/simple.rs:288:41 | LL | while let (&mut Either::One(_t),) = (&mut em.clone(),) { } | -- ^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content @@ -691,13 +691,13 @@ LL | while let (&mut Either::One(_t),) = (&mut em.clone(),) { } | data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:288:33 + --> $DIR/simple.rs:288:33 | LL | while let (&mut Either::One(_t),) = (&mut em.clone(),) { } | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:290:11 + --> $DIR/simple.rs:290:11 | LL | match (&mut em.clone(),) { | ^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content @@ -708,7 +708,7 @@ LL | (&mut Either::Two(_t),) => (), | -- ...and here | note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:292:27 + --> $DIR/simple.rs:292:27 | LL | (&mut Either::One(_t),) => (), | ^^ @@ -716,7 +716,7 @@ LL | (&mut Either::Two(_t),) => (), | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:300:18 + --> $DIR/simple.rs:300:18 | LL | let &X(_t) = &x; | ------ ^^ cannot move out of borrowed content @@ -725,13 +725,13 @@ LL | let &X(_t) = &x; | help: consider removing the `&`: `X(_t)` | note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:300:12 + --> $DIR/simple.rs:300:12 | LL | let &X(_t) = &x; | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:304:31 + --> $DIR/simple.rs:304:31 | LL | if let &Either::One(_t) = &e { } | ---------------- ^^ cannot move out of borrowed content @@ -740,13 +740,13 @@ LL | if let &Either::One(_t) = &e { } | help: consider removing the `&`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:304:25 + --> $DIR/simple.rs:304:25 | LL | if let &Either::One(_t) = &e { } | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:308:34 + --> $DIR/simple.rs:308:34 | LL | while let &Either::One(_t) = &e { } | ---------------- ^^ cannot move out of borrowed content @@ -755,13 +755,13 @@ LL | while let &Either::One(_t) = &e { } | help: consider removing the `&`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:308:28 + --> $DIR/simple.rs:308:28 | LL | while let &Either::One(_t) = &e { } | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:312:11 + --> $DIR/simple.rs:312:11 | LL | match &e { | ^^ cannot move out of borrowed content @@ -773,13 +773,13 @@ LL | &Either::One(_t) | help: consider removing the `&`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:314:22 + --> $DIR/simple.rs:314:22 | LL | &Either::One(_t) | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:320:11 + --> $DIR/simple.rs:320:11 | LL | match &e { | ^^ cannot move out of borrowed content @@ -791,13 +791,13 @@ LL | &Either::One(_t) => (), | help: consider removing the `&`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:322:22 + --> $DIR/simple.rs:322:22 | LL | &Either::One(_t) => (), | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:327:11 + --> $DIR/simple.rs:327:11 | LL | match &e { | ^^ cannot move out of borrowed content @@ -809,13 +809,13 @@ LL | &Either::One(_t) => (), | help: consider removing the `&`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:329:22 + --> $DIR/simple.rs:329:22 | LL | &Either::One(_t) => (), | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:335:22 + --> $DIR/simple.rs:335:22 | LL | let &mut X(_t) = &mut xm; | ---------- ^^^^^^^ cannot move out of borrowed content @@ -824,13 +824,13 @@ LL | let &mut X(_t) = &mut xm; | help: consider removing the `&mut`: `X(_t)` | note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:335:16 + --> $DIR/simple.rs:335:16 | LL | let &mut X(_t) = &mut xm; | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:339:35 + --> $DIR/simple.rs:339:35 | LL | if let &mut Either::One(_t) = &mut em { } | -------------------- ^^^^^^^ cannot move out of borrowed content @@ -839,13 +839,13 @@ LL | if let &mut Either::One(_t) = &mut em { } | help: consider removing the `&mut`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:339:29 + --> $DIR/simple.rs:339:29 | LL | if let &mut Either::One(_t) = &mut em { } | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:343:38 + --> $DIR/simple.rs:343:38 | LL | while let &mut Either::One(_t) = &mut em { } | -------------------- ^^^^^^^ cannot move out of borrowed content @@ -854,13 +854,13 @@ LL | while let &mut Either::One(_t) = &mut em { } | help: consider removing the `&mut`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:343:32 + --> $DIR/simple.rs:343:32 | LL | while let &mut Either::One(_t) = &mut em { } | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:347:11 + --> $DIR/simple.rs:347:11 | LL | match &mut em { | ^^^^^^^ cannot move out of borrowed content @@ -872,13 +872,13 @@ LL | &mut Either::One(_t) | help: consider removing the `&mut`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:349:26 + --> $DIR/simple.rs:349:26 | LL | &mut Either::One(_t) | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:355:11 + --> $DIR/simple.rs:355:11 | LL | match &mut em { | ^^^^^^^ cannot move out of borrowed content @@ -890,13 +890,13 @@ LL | &mut Either::One(_t) => (), | help: consider removing the `&mut`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:357:26 + --> $DIR/simple.rs:357:26 | LL | &mut Either::One(_t) => (), | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:362:11 + --> $DIR/simple.rs:362:11 | LL | match &mut em { | ^^^^^^^ cannot move out of borrowed content @@ -908,13 +908,13 @@ LL | &mut Either::One(_t) => (), | help: consider removing the `&mut`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:364:26 + --> $DIR/simple.rs:364:26 | LL | &mut Either::One(_t) => (), | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:369:11 + --> $DIR/simple.rs:369:11 | LL | match &mut em { | ^^^^^^^ cannot move out of borrowed content @@ -926,304 +926,13 @@ LL | &mut Either::One(_t) => (), | help: consider removing the `&mut`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:371:26 + --> $DIR/simple.rs:371:26 | LL | &mut Either::One(_t) => (), | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:379:27 - | -LL | let &(X(_t), X(_u)) = &(x.clone(), x.clone()); - | --------------- ^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content - | | | | - | | | ...and here - | | data moved here - | help: consider removing the `&`: `(X(_t), X(_u))` - | -note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:379:13 - | -LL | let &(X(_t), X(_u)) = &(x.clone(), x.clone()); - | ^^ ^^ - -error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:383:50 - | -LL | if let &(Either::One(_t), Either::Two(_u)) = &(e.clone(), e.clone()) { } - | ----------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content - | | | | - | | | ...and here - | | data moved here - | 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 - --> $DIR/dont-suggest-ref.rs:383:26 - | -LL | if let &(Either::One(_t), Either::Two(_u)) = &(e.clone(), e.clone()) { } - | ^^ ^^ - -error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:387:53 - | -LL | while let &(Either::One(_t), Either::Two(_u)) = &(e.clone(), e.clone()) { } - | ----------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content - | | | | - | | | ...and here - | | data moved here - | 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 - --> $DIR/dont-suggest-ref.rs:387:29 - | -LL | while let &(Either::One(_t), Either::Two(_u)) = &(e.clone(), e.clone()) { } - | ^^ ^^ - -error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:391:11 - | -LL | match &(e.clone(), e.clone()) { - | ^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content -LL | //~^ ERROR cannot move -LL | &(Either::One(_t), Either::Two(_u)) => (), - | -- -- ...and here - | | - | data moved here -... -LL | &(Either::Two(_t), Either::One(_u)) => (), - | -- ...and here -- ...and here - | -note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:393:23 - | -LL | &(Either::One(_t), Either::Two(_u)) => (), - | ^^ ^^ -... -LL | &(Either::Two(_t), Either::One(_u)) => (), - | ^^ ^^ -help: consider removing the `&` - | -LL | (Either::One(_t), Either::Two(_u)) => (), - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -help: consider removing the `&` - | -LL | (Either::Two(_t), Either::One(_u)) => (), - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:401:11 - | -LL | match &(e.clone(), e.clone()) { - | ^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content -LL | //~^ ERROR cannot move -LL | &(Either::One(_t), Either::Two(_u)) - | ----------------------------------- - | | | | - | | | ...and here - | | data moved here - | 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 - --> $DIR/dont-suggest-ref.rs:403:23 - | -LL | &(Either::One(_t), Either::Two(_u)) - | ^^ ^^ - -error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:410:11 - | -LL | match &(e.clone(), e.clone()) { - | ^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content -LL | //~^ ERROR cannot move -LL | &(Either::One(_t), Either::Two(_u)) => (), - | ----------------------------------- - | | | | - | | | ...and here - | | data moved here - | 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 - --> $DIR/dont-suggest-ref.rs:412:23 - | -LL | &(Either::One(_t), Either::Two(_u)) => (), - | ^^ ^^ - -error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:418:11 - | -LL | match &(e.clone(), e.clone()) { - | ^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content -LL | //~^ ERROR cannot move -LL | &(Either::One(_t), Either::Two(_u)) => (), - | ----------------------------------- - | | | | - | | | ...and here - | | data moved here - | 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 - --> $DIR/dont-suggest-ref.rs:420:23 - | -LL | &(Either::One(_t), Either::Two(_u)) => (), - | ^^ ^^ - -error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:431:31 - | -LL | let &mut (X(_t), X(_u)) = &mut (xm.clone(), xm.clone()); - | ------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content - | | | | - | | | ...and here - | | data moved here - | help: consider removing the `&mut`: `(X(_t), X(_u))` - | -note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:431:17 - | -LL | let &mut (X(_t), X(_u)) = &mut (xm.clone(), xm.clone()); - | ^^ ^^ - -error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:435:54 - | -LL | if let &mut (Either::One(_t), Either::Two(_u)) = &mut (em.clone(), em.clone()) { } - | --------------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content - | | | | - | | | ...and here - | | data moved here - | 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 - --> $DIR/dont-suggest-ref.rs:435:30 - | -LL | if let &mut (Either::One(_t), Either::Two(_u)) = &mut (em.clone(), em.clone()) { } - | ^^ ^^ - -error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:439:57 - | -LL | while let &mut (Either::One(_t), Either::Two(_u)) = &mut (em.clone(), em.clone()) { } - | --------------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content - | | | | - | | | ...and here - | | data moved here - | 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 - --> $DIR/dont-suggest-ref.rs:439:33 - | -LL | while let &mut (Either::One(_t), Either::Two(_u)) = &mut (em.clone(), em.clone()) { } - | ^^ ^^ - -error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:443:11 - | -LL | match &mut (em.clone(), em.clone()) { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content -LL | //~^ ERROR cannot move -LL | &mut (Either::One(_t), Either::Two(_u)) => (), - | -- -- ...and here - | | - | data moved here -... -LL | &mut (Either::Two(_t), Either::One(_u)) => (), - | -- ...and here -- ...and here - | -note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:445:27 - | -LL | &mut (Either::One(_t), Either::Two(_u)) => (), - | ^^ ^^ -... -LL | &mut (Either::Two(_t), Either::One(_u)) => (), - | ^^ ^^ -help: consider removing the `&mut` - | -LL | (Either::One(_t), Either::Two(_u)) => (), - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -help: consider removing the `&mut` - | -LL | (Either::Two(_t), Either::One(_u)) => (), - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:453:11 - | -LL | match &mut (em.clone(), em.clone()) { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content -LL | //~^ ERROR cannot move -LL | &mut (Either::One(_t), Either::Two(_u)) - | --------------------------------------- - | | | | - | | | ...and here - | | data moved here - | 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 - --> $DIR/dont-suggest-ref.rs:455:27 - | -LL | &mut (Either::One(_t), Either::Two(_u)) - | ^^ ^^ - -error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:462:11 - | -LL | match &mut (em.clone(), em.clone()) { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content -LL | //~^ ERROR cannot move -LL | &mut (Either::One(_t), Either::Two(_u)) => (), - | --------------------------------------- - | | | | - | | | ...and here - | | data moved here - | 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 - --> $DIR/dont-suggest-ref.rs:464:27 - | -LL | &mut (Either::One(_t), Either::Two(_u)) => (), - | ^^ ^^ - -error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:470:11 - | -LL | match &mut (em.clone(), em.clone()) { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content -LL | //~^ ERROR cannot move -LL | &mut (Either::One(_t), Either::Two(_u)) => (), - | --------------------------------------- - | | | | - | | | ...and here - | | data moved here - | 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 - --> $DIR/dont-suggest-ref.rs:472:27 - | -LL | &mut (Either::One(_t), Either::Two(_u)) => (), - | ^^ ^^ - -error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:478:11 - | -LL | match &mut (em.clone(), em.clone()) { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content -LL | //~^ ERROR cannot move -LL | &mut (Either::One(_t), Either::Two(_u)) => (), - | --------------------------------------- - | | | | - | | | ...and here - | | data moved here - | 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 - --> $DIR/dont-suggest-ref.rs:480:27 - | -LL | &mut (Either::One(_t), Either::Two(_u)) => (), - | ^^ ^^ - -error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:214:11 + --> $DIR/simple.rs:214:11 | LL | fn f1(&X(_t): &X) { } | ^^^--^ @@ -1233,13 +942,13 @@ LL | fn f1(&X(_t): &X) { } | help: consider removing the `&`: `X(_t)` | note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:214:14 + --> $DIR/simple.rs:214:14 | LL | fn f1(&X(_t): &X) { } | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:261:11 + --> $DIR/simple.rs:261:11 | LL | fn f2(&mut X(_t): &mut X) { } | ^^^^^^^--^ @@ -1249,13 +958,13 @@ LL | fn f2(&mut X(_t): &mut X) { } | help: consider removing the `&mut`: `X(_t)` | note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:261:18 + --> $DIR/simple.rs:261:18 | LL | fn f2(&mut X(_t): &mut X) { } | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:281:11 + --> $DIR/simple.rs:281:11 | LL | fn f3((&X(_t),): (&X,)) { } | ^^^^--^^^ @@ -1264,13 +973,13 @@ LL | fn f3((&X(_t),): (&X,)) { } | cannot move out of borrowed content | note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:281:15 + --> $DIR/simple.rs:281:15 | LL | fn f3((&X(_t),): (&X,)) { } | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:295:11 + --> $DIR/simple.rs:295:11 | LL | fn f4((&mut X(_t),): (&mut X,)) { } | ^^^^^^^^--^^^ @@ -1279,45 +988,11 @@ LL | fn f4((&mut X(_t),): (&mut X,)) { } | cannot move out of borrowed content | note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:295:19 + --> $DIR/simple.rs:295:19 | LL | fn f4((&mut X(_t),): (&mut X,)) { } | ^^ -error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:426:11 - | -LL | fn f5(&(X(_t), X(_u)): &(X, X)) { } - | ^^^^--^^^^^--^^ - | | | | - | | | ...and here - | | data moved here - | cannot move out of borrowed content - | help: consider removing the `&`: `(X(_t), X(_u))` - | -note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:426:15 - | -LL | fn f5(&(X(_t), X(_u)): &(X, X)) { } - | ^^ ^^ - -error[E0507]: cannot move out of borrowed content - --> $DIR/dont-suggest-ref.rs:486:11 - | -LL | fn f6(&mut (X(_t), X(_u)): &mut (X, X)) { } - | ^^^^^^^^--^^^^^--^^ - | | | | - | | | ...and here - | | data moved here - | cannot move out of borrowed content - | help: consider removing the `&mut`: `(X(_t), X(_u))` - | -note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/dont-suggest-ref.rs:486:19 - | -LL | fn f6(&mut (X(_t), X(_u)): &mut (X, X)) { } - | ^^ ^^ - -error: aborting due to 77 previous errors +error: aborting due to 60 previous errors For more information about this error, try `rustc --explain E0507`.