diff options
| author | ashtneoi <ashtneoi@gmail.com> | 2018-08-12 13:27:14 -0700 |
|---|---|---|
| committer | ashtneoi <ashtneoi@gmail.com> | 2018-08-15 15:14:21 -0700 |
| commit | 701c74e067a76e84725b8efeaae7234512058667 (patch) | |
| tree | 49c4ae99994fda8803b2d7b577fe48a1178c8a8f | |
| parent | b05e9a7f7724281c43ee7225c4f43cff9e05e617 (diff) | |
| download | rust-701c74e067a76e84725b8efeaae7234512058667.tar.gz rust-701c74e067a76e84725b8efeaae7234512058667.zip | |
Make move error suggestions clearer
| -rw-r--r-- | src/librustc_mir/borrow_check/move_errors.rs | 7 | ||||
| -rw-r--r-- | src/test/ui/suggestions/dont-suggest-ref.rs | 80 | ||||
| -rw-r--r-- | src/test/ui/suggestions/dont-suggest-ref.stderr | 80 |
3 files changed, 85 insertions, 82 deletions
diff --git a/src/librustc_mir/borrow_check/move_errors.rs b/src/librustc_mir/borrow_check/move_errors.rs index 7ddb5a4536b..ce7206be4c3 100644 --- a/src/librustc_mir/borrow_check/move_errors.rs +++ b/src/librustc_mir/borrow_check/move_errors.rs @@ -354,7 +354,7 @@ impl<'a, 'gcx, 'tcx> MirBorrowckCtxt<'a, 'gcx, 'tcx> { // `*IndexMut::index_mut(&mut a, b)`. err.span_suggestion( span, - "consider removing this dereference operator", + "consider removing the `*`", snippet[1..].to_owned(), ); } else { @@ -400,16 +400,19 @@ impl<'a, 'gcx, 'tcx> MirBorrowckCtxt<'a, 'gcx, 'tcx> { if pat_snippet.starts_with('&') { let pat_snippet = pat_snippet[1..].trim_left(); let suggestion; + let to_remove; if pat_snippet.starts_with("mut") && pat_snippet["mut".len()..].starts_with(Pattern_White_Space) { suggestion = pat_snippet["mut".len()..].trim_left(); + to_remove = "&mut"; } else { suggestion = pat_snippet; + to_remove = "&"; } err.span_suggestion( pat_span, - "consider removing this borrow operator", + &format!("consider removing the `{}`", to_remove), suggestion.to_owned(), ); } diff --git a/src/test/ui/suggestions/dont-suggest-ref.rs b/src/test/ui/suggestions/dont-suggest-ref.rs index c9a5985b8bb..b7047b01af0 100644 --- a/src/test/ui/suggestions/dont-suggest-ref.rs +++ b/src/test/ui/suggestions/dont-suggest-ref.rs @@ -46,26 +46,26 @@ pub fn main() { let X(_t) = *s; //~^ ERROR cannot move - //~| HELP consider removing this dereference operator + //~| HELP consider removing the `*` //~| SUGGESTION s if let Either::One(_t) = *r { } //~^ ERROR cannot move - //~| HELP consider removing this dereference operator + //~| HELP consider removing the `*` //~| SUGGESTION r while let Either::One(_t) = *r { } //~^ ERROR cannot move - //~| HELP consider removing this dereference operator + //~| HELP consider removing the `*` //~| SUGGESTION r match *r { //~^ ERROR cannot move - //~| HELP consider removing this dereference operator + //~| HELP consider removing the `*` //~| SUGGESTION r Either::One(_t) | Either::Two(_t) => (), } match *r { //~^ ERROR cannot move - //~| HELP consider removing this dereference operator + //~| HELP consider removing the `*` //~| SUGGESTION r Either::One(_t) => (), Either::Two(ref _t) => (), @@ -74,26 +74,26 @@ pub fn main() { let X(_t) = *sm; //~^ ERROR cannot move - //~| HELP consider removing this dereference operator + //~| HELP consider removing the `*` //~| SUGGESTION sm if let Either::One(_t) = *rm { } //~^ ERROR cannot move - //~| HELP consider removing this dereference operator + //~| HELP consider removing the `*` //~| SUGGESTION rm while let Either::One(_t) = *rm { } //~^ ERROR cannot move - //~| HELP consider removing this dereference operator + //~| HELP consider removing the `*` //~| SUGGESTION rm match *rm { //~^ ERROR cannot move - //~| HELP consider removing this dereference operator + //~| HELP consider removing the `*` //~| SUGGESTION rm Either::One(_t) | Either::Two(_t) => (), } match *rm { //~^ ERROR cannot move - //~| HELP consider removing this dereference operator + //~| HELP consider removing the `*` //~| SUGGESTION rm Either::One(_t) => (), Either::Two(ref _t) => (), @@ -101,7 +101,7 @@ pub fn main() { } match *rm { //~^ ERROR cannot move - //~| HELP consider removing this dereference operator + //~| HELP consider removing the `*` //~| SUGGESTION rm Either::One(_t) => (), Either::Two(ref mut _t) => (), @@ -176,20 +176,20 @@ pub fn main() { let &X(_t) = s; //~^ ERROR cannot move - //~| HELP consider removing this borrow operator + //~| HELP consider removing the `&` //~| SUGGESTION X(_t) if let &Either::One(_t) = r { } //~^ ERROR cannot move - //~| HELP consider removing this borrow operator + //~| HELP consider removing the `&` //~| SUGGESTION Either::One(_t) while let &Either::One(_t) = r { } //~^ ERROR cannot move - //~| HELP consider removing this borrow operator + //~| HELP consider removing the `&` //~| SUGGESTION Either::One(_t) match r { //~^ ERROR cannot move &Either::One(_t) - //~^ HELP consider removing this borrow operator + //~^ HELP consider removing the `&` //~| SUGGESTION Either::One(_t) | &Either::Two(_t) => (), // TODO: would really like a suggestion here too @@ -197,87 +197,87 @@ pub fn main() { match r { //~^ ERROR cannot move &Either::One(_t) => (), - //~^ HELP consider removing this borrow operator + //~^ HELP consider removing the `&` //~| SUGGESTION Either::One(_t) &Either::Two(ref _t) => (), } match r { //~^ ERROR cannot move &Either::One(_t) => (), - //~^ HELP consider removing this borrow operator + //~^ HELP consider removing the `&` //~| SUGGESTION Either::One(_t) Either::Two(_t) => (), } fn f1(&X(_t): &X) { } //~^ ERROR cannot move - //~| HELP consider removing this borrow operator + //~| HELP consider removing the `&` //~| SUGGESTION X(_t) let &mut X(_t) = sm; //~^ ERROR cannot move - //~| HELP consider removing this borrow operator + //~| HELP consider removing the `&mut` //~| SUGGESTION X(_t) if let &mut Either::One(_t) = rm { } //~^ ERROR cannot move - //~| HELP consider removing this borrow operator + //~| HELP consider removing the `&mut` //~| SUGGESTION Either::One(_t) while let &mut Either::One(_t) = rm { } //~^ ERROR cannot move - //~| HELP consider removing this borrow operator + //~| HELP consider removing the `&mut` //~| SUGGESTION Either::One(_t) match rm { //~^ ERROR cannot move &mut Either::One(_t) => (), - //~^ HELP consider removing this borrow operator + //~^ HELP consider removing the `&mut` //~| SUGGESTION Either::One(_t) &mut Either::Two(_t) => (), - //~^ HELP consider removing this borrow operator + //~^ HELP consider removing the `&mut` //~| SUGGESTION Either::Two(_t) } match rm { //~^ ERROR cannot move &mut Either::One(_t) => (), - //~^ HELP consider removing this borrow operator + //~^ HELP consider removing the `&mut` //~| SUGGESTION Either::One(_t) &mut Either::Two(ref _t) => (), } match rm { //~^ ERROR cannot move &mut Either::One(_t) => (), - //~^ HELP consider removing this borrow operator + //~^ HELP consider removing the `&mut` //~| SUGGESTION Either::One(_t) &mut Either::Two(ref mut _t) => (), } match rm { //~^ ERROR cannot move &mut Either::One(_t) => (), - //~^ HELP consider removing this borrow operator + //~^ HELP consider removing the `&mut` //~| SUGGESTION Either::One(_t) Either::Two(_t) => (), } fn f2(&mut X(_t): &mut X) { } //~^ ERROR cannot move - //~| HELP consider removing this borrow operator + //~| HELP consider removing the `&mut` //~| SUGGESTION X(_t) // -------- let &X(_t) = &x; //~^ ERROR cannot move - //~| HELP consider removing this borrow operator + //~| HELP consider removing the `&` //~| SUGGESTION X(_t) if let &Either::One(_t) = &e { } //~^ ERROR cannot move - //~| HELP consider removing this borrow operator + //~| HELP consider removing the `&` //~| SUGGESTION Either::One(_t) while let &Either::One(_t) = &e { } //~^ ERROR cannot move - //~| HELP consider removing this borrow operator + //~| HELP consider removing the `&` //~| SUGGESTION Either::One(_t) match &e { //~^ ERROR cannot move &Either::One(_t) - //~^ HELP consider removing this borrow operator + //~^ HELP consider removing the `&` //~| SUGGESTION Either::One(_t) | &Either::Two(_t) => (), // TODO: would really like a suggestion here too @@ -285,34 +285,34 @@ pub fn main() { match &e { //~^ ERROR cannot move &Either::One(_t) => (), - //~^ HELP consider removing this borrow operator + //~^ HELP consider removing the `&` //~| SUGGESTION Either::One(_t) &Either::Two(ref _t) => (), } match &e { //~^ ERROR cannot move &Either::One(_t) => (), - //~^ HELP consider removing this borrow operator + //~^ HELP consider removing the `&` //~| SUGGESTION Either::One(_t) Either::Two(_t) => (), } let &mut X(_t) = &mut xm; //~^ ERROR cannot move - //~| HELP consider removing this borrow operator + //~| HELP consider removing the `&mut` //~| SUGGESTION X(_t) if let &mut Either::One(_t) = &mut em { } //~^ ERROR cannot move - //~| HELP consider removing this borrow operator + //~| HELP consider removing the `&mut` //~| SUGGESTION Either::One(_t) while let &mut Either::One(_t) = &mut em { } //~^ ERROR cannot move - //~| HELP consider removing this borrow operator + //~| HELP consider removing the `&mut` //~| SUGGESTION Either::One(_t) match &mut em { //~^ ERROR cannot move &mut Either::One(_t) - //~^ HELP consider removing this borrow operator + //~^ HELP consider removing the `&mut` //~| SUGGESTION Either::One(_t) | &mut Either::Two(_t) => (), // TODO: would really like a suggestion here too @@ -320,21 +320,21 @@ pub fn main() { match &mut em { //~^ ERROR cannot move &mut Either::One(_t) => (), - //~^ HELP consider removing this borrow operator + //~^ HELP consider removing the `&mut` //~| SUGGESTION Either::One(_t) &mut Either::Two(ref _t) => (), } match &mut em { //~^ ERROR cannot move &mut Either::One(_t) => (), - //~^ HELP consider removing this borrow operator + //~^ HELP consider removing the `&mut` //~| SUGGESTION Either::One(_t) &mut Either::Two(ref mut _t) => (), } match &mut em { //~^ ERROR cannot move &mut Either::One(_t) => (), - //~^ HELP consider removing this borrow operator + //~^ HELP consider removing the `&mut` //~| SUGGESTION Either::One(_t) Either::Two(_t) => (), } diff --git a/src/test/ui/suggestions/dont-suggest-ref.stderr b/src/test/ui/suggestions/dont-suggest-ref.stderr index 0493a9fa6e8..f18b609a175 100644 --- a/src/test/ui/suggestions/dont-suggest-ref.stderr +++ b/src/test/ui/suggestions/dont-suggest-ref.stderr @@ -5,7 +5,7 @@ LL | let X(_t) = *s; | -- ^^ | | | | | cannot move out of borrowed content - | | help: consider removing this dereference operator: `s` + | | help: consider removing the `*`: `s` | data moved here | note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait @@ -21,7 +21,7 @@ LL | if let Either::One(_t) = *r { } | -- ^^ | | | | | cannot move out of borrowed content - | | help: consider removing this dereference operator: `r` + | | help: consider removing the `*`: `r` | data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait @@ -37,7 +37,7 @@ LL | while let Either::One(_t) = *r { } | -- ^^ | | | | | cannot move out of borrowed content - | | help: consider removing this dereference operator: `r` + | | help: consider removing the `*`: `r` | data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait @@ -53,7 +53,7 @@ LL | match *r { | ^^ | | | cannot move out of borrowed content - | help: consider removing this dereference operator: `r` + | help: consider removing the `*`: `r` ... LL | Either::One(_t) | -- data moved here @@ -71,7 +71,7 @@ LL | match *r { | ^^ | | | cannot move out of borrowed content - | help: consider removing this dereference operator: `r` + | help: consider removing the `*`: `r` ... LL | Either::One(_t) => (), | -- data moved here @@ -89,7 +89,7 @@ LL | let X(_t) = *sm; | -- ^^^ | | | | | cannot move out of borrowed content - | | help: consider removing this dereference operator: `sm` + | | help: consider removing the `*`: `sm` | data moved here | note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait @@ -105,7 +105,7 @@ LL | if let Either::One(_t) = *rm { } | -- ^^^ | | | | | cannot move out of borrowed content - | | help: consider removing this dereference operator: `rm` + | | help: consider removing the `*`: `rm` | data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait @@ -121,7 +121,7 @@ LL | while let Either::One(_t) = *rm { } | -- ^^^ | | | | | cannot move out of borrowed content - | | help: consider removing this dereference operator: `rm` + | | help: consider removing the `*`: `rm` | data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait @@ -137,7 +137,7 @@ LL | match *rm { | ^^^ | | | cannot move out of borrowed content - | help: consider removing this dereference operator: `rm` + | help: consider removing the `*`: `rm` ... LL | Either::One(_t) | -- data moved here @@ -155,7 +155,7 @@ LL | match *rm { | ^^^ | | | cannot move out of borrowed content - | help: consider removing this dereference operator: `rm` + | help: consider removing the `*`: `rm` ... LL | Either::One(_t) => (), | -- data moved here @@ -173,7 +173,7 @@ LL | match *rm { | ^^^ | | | cannot move out of borrowed content - | help: consider removing this dereference operator: `rm` + | help: consider removing the `*`: `rm` ... LL | Either::One(_t) => (), | -- data moved here @@ -377,7 +377,7 @@ LL | let &X(_t) = s; | ------ ^ cannot move out of borrowed content | | | | | data moved here - | help: consider removing this borrow operator: `X(_t)` + | 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:177:12 @@ -392,7 +392,7 @@ LL | if let &Either::One(_t) = r { } | ---------------- ^ cannot move out of borrowed content | | | | | data moved here - | help: consider removing this borrow operator: `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:181:25 @@ -407,7 +407,7 @@ LL | while let &Either::One(_t) = r { } | ---------------- ^ cannot move out of borrowed content | | | | | data moved here - | help: consider removing this borrow operator: `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:185:28 @@ -425,7 +425,7 @@ LL | &Either::One(_t) | ---------------- | | | | | data moved here - | help: consider removing this borrow operator: `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:191:22 @@ -443,7 +443,7 @@ LL | &Either::One(_t) => (), | ---------------- | | | | | data moved here - | help: consider removing this borrow operator: `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:199:22 @@ -461,7 +461,7 @@ LL | &Either::One(_t) => (), | ---------------- | | | | | data moved here - | help: consider removing this borrow operator: `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:206:22 @@ -476,7 +476,7 @@ LL | let &mut X(_t) = sm; | ---------- ^^ cannot move out of borrowed content | | | | | data moved here - | help: consider removing this borrow operator: `X(_t)` + | 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:216:16 @@ -491,7 +491,7 @@ LL | if let &mut Either::One(_t) = rm { } | -------------------- ^^ cannot move out of borrowed content | | | | | data moved here - | help: consider removing this borrow operator: `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:220:29 @@ -506,7 +506,7 @@ LL | while let &mut Either::One(_t) = rm { } | -------------------- ^^ cannot move out of borrowed content | | | | | data moved here - | help: consider removing this borrow operator: `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:224:32 @@ -536,11 +536,11 @@ note: move occurs because `_t` has type `X`, which does not implement the `Copy` | LL | &mut Either::Two(_t) => (), | ^^ -help: consider removing this borrow operator +help: consider removing the `&mut` | LL | Either::One(_t) => (), | ^^^^^^^^^^^^^^^ -help: consider removing this borrow operator +help: consider removing the `&mut` | LL | Either::Two(_t) => (), | ^^^^^^^^^^^^^^^ @@ -555,7 +555,7 @@ LL | &mut Either::One(_t) => (), | -------------------- | | | | | data moved here - | help: consider removing this borrow operator: `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:239:26 @@ -573,7 +573,7 @@ LL | &mut Either::One(_t) => (), | -------------------- | | | | | data moved here - | help: consider removing this borrow operator: `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:246:26 @@ -591,7 +591,7 @@ LL | &mut Either::One(_t) => (), | -------------------- | | | | | data moved here - | help: consider removing this borrow operator: `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:253:26 @@ -606,7 +606,7 @@ LL | let &X(_t) = &x; | ------ ^^ cannot move out of borrowed content | | | | | data moved here - | help: consider removing this borrow operator: `X(_t)` + | 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:265:12 @@ -621,7 +621,7 @@ LL | if let &Either::One(_t) = &e { } | ---------------- ^^ cannot move out of borrowed content | | | | | data moved here - | help: consider removing this borrow operator: `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:269:25 @@ -636,7 +636,7 @@ LL | while let &Either::One(_t) = &e { } | ---------------- ^^ cannot move out of borrowed content | | | | | data moved here - | help: consider removing this borrow operator: `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:273:28 @@ -654,7 +654,7 @@ LL | &Either::One(_t) | ---------------- | | | | | data moved here - | help: consider removing this borrow operator: `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:279:22 @@ -672,7 +672,7 @@ LL | &Either::One(_t) => (), | ---------------- | | | | | data moved here - | help: consider removing this borrow operator: `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:287:22 @@ -690,7 +690,7 @@ LL | &Either::One(_t) => (), | ---------------- | | | | | data moved here - | help: consider removing this borrow operator: `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:294:22 @@ -705,7 +705,7 @@ LL | let &mut X(_t) = &mut xm; | ---------- ^^^^^^^ cannot move out of borrowed content | | | | | data moved here - | help: consider removing this borrow operator: `X(_t)` + | 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:300:16 @@ -720,7 +720,7 @@ LL | if let &mut Either::One(_t) = &mut em { } | -------------------- ^^^^^^^ cannot move out of borrowed content | | | | | data moved here - | help: consider removing this borrow operator: `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:304:29 @@ -735,7 +735,7 @@ LL | while let &mut Either::One(_t) = &mut em { } | -------------------- ^^^^^^^ cannot move out of borrowed content | | | | | data moved here - | help: consider removing this borrow operator: `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:308:32 @@ -753,7 +753,7 @@ LL | &mut Either::One(_t) | -------------------- | | | | | data moved here - | help: consider removing this borrow operator: `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:314:26 @@ -771,7 +771,7 @@ LL | &mut Either::One(_t) => (), | -------------------- | | | | | data moved here - | help: consider removing this borrow operator: `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:322:26 @@ -789,7 +789,7 @@ LL | &mut Either::One(_t) => (), | -------------------- | | | | | data moved here - | help: consider removing this borrow operator: `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:329:26 @@ -807,7 +807,7 @@ LL | &mut Either::One(_t) => (), | -------------------- | | | | | data moved here - | help: consider removing this borrow operator: `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:336:26 @@ -823,7 +823,7 @@ LL | fn f1(&X(_t): &X) { } | | | | | data moved here | cannot move out of borrowed content - | help: consider removing this borrow operator: `X(_t)` + | 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:211:14 @@ -839,7 +839,7 @@ LL | fn f2(&mut X(_t): &mut X) { } | | | | | data moved here | cannot move out of borrowed content - | help: consider removing this borrow operator: `X(_t)` + | 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:258:18 |
