Remove unnecessary underscore

This commit is contained in:
ashtneoi 2018-08-12 16:07:19 -07:00
parent 8135372ed1
commit 40b5118c8a
2 changed files with 7 additions and 7 deletions

View File

@ -39,7 +39,7 @@ pub fn main() {
let vx = vec![X(Y)];
let vs_ = &vx;
let vs = &vx;
let vsm = &mut vec![X(Y)];
// --------
@ -108,10 +108,10 @@ pub fn main() {
// FIXME: should suggest removing `ref mut` too
}
let X(_t) = vs_[0];
let X(_t) = vs[0];
//~^ ERROR cannot move
//~| HELP consider borrowing here
//~| SUGGESTION &vs_[0]
//~| SUGGESTION &vs[0]
if let Either::One(_t) = vr[0] { }
//~^ ERROR cannot move
//~| HELP consider borrowing here

View File

@ -187,17 +187,17 @@ LL | Either::One(_t) => (),
error[E0507]: cannot move out of borrowed content
--> $DIR/dont-suggest-ref.rs:111:17
|
LL | let X(_t) = vs_[0];
| -- ^^^^^^
LL | let X(_t) = vs[0];
| -- ^^^^^
| | |
| | cannot move out of borrowed content
| | help: consider borrowing here: `&vs_[0]`
| | help: consider borrowing here: `&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:111:11
|
LL | let X(_t) = vs_[0];
LL | let X(_t) = vs[0];
| ^^
error[E0507]: cannot move out of borrowed content