mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
Remove unnecessary underscore
This commit is contained in:
parent
8135372ed1
commit
40b5118c8a
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user