parent
e46416eed6
commit
4f7c257fd8
@ -231,7 +231,7 @@ fn ast_block_stmts(
|
||||
remainder_span,
|
||||
pattern,
|
||||
None,
|
||||
Some((None, initializer_span)),
|
||||
Some((Some(&destination), initializer_span)),
|
||||
);
|
||||
this.visit_primary_bindings(
|
||||
pattern,
|
||||
|
@ -32,15 +32,19 @@ LL + if let E::Bar(identifier) = &s.x {
|
||||
|
|
||||
|
||||
error[E0507]: cannot move out of a shared reference
|
||||
--> $DIR/by-move-pattern-binding.rs:25:17
|
||||
--> $DIR/by-move-pattern-binding.rs:25:31
|
||||
|
|
||||
LL | let &E::Bar(identifier) = &s.x else {
|
||||
| ^^^^^^^^^^ move occurs because value has type `String`, which does not implement the `Copy` trait
|
||||
| ---------- ^^^^
|
||||
| |
|
||||
| data moved here
|
||||
| move occurs because `identifier` has type `String`, which does not implement the `Copy` trait
|
||||
|
|
||||
help: consider borrowing here
|
||||
help: consider removing the borrow
|
||||
|
|
||||
LL - let &E::Bar(identifier) = &s.x else {
|
||||
LL + let E::Bar(identifier) = &s.x else {
|
||||
|
|
||||
LL | let &E::Bar(&identifier) = &s.x else {
|
||||
| +
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
|
@ -319,7 +319,6 @@ struct Testing {
|
||||
fn testing(a: &Testing) {
|
||||
let Some(_s) = a.a else {
|
||||
//~^ ERROR cannot move
|
||||
//~| HELP consider borrowing
|
||||
return;
|
||||
};
|
||||
}
|
||||
|
@ -902,15 +902,13 @@ LL | fn f4((&mut X(_t),): (&mut X,)) { }
|
||||
| move occurs because `_t` has type `Y`, which does not implement the `Copy` trait
|
||||
|
||||
error[E0507]: cannot move out of `a.a` as enum variant `Some` which is behind a shared reference
|
||||
--> $DIR/simple.rs:320:14
|
||||
--> $DIR/simple.rs:320:20
|
||||
|
|
||||
LL | let Some(_s) = a.a else {
|
||||
| ^^ move occurs because `a.a.0` has type `String`, which does not implement the `Copy` trait
|
||||
|
|
||||
help: consider borrowing here
|
||||
|
|
||||
LL | let Some(&_s) = a.a else {
|
||||
| +
|
||||
| -- ^^^
|
||||
| |
|
||||
| data moved here
|
||||
| move occurs because `_s` has type `String`, which does not implement the `Copy` trait
|
||||
|
||||
error: aborting due to 61 previous errors
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user