mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 16:54:01 +00:00
parent
e46416eed6
commit
4f7c257fd8
@ -231,7 +231,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
|||||||
remainder_span,
|
remainder_span,
|
||||||
pattern,
|
pattern,
|
||||||
None,
|
None,
|
||||||
Some((None, initializer_span)),
|
Some((Some(&destination), initializer_span)),
|
||||||
);
|
);
|
||||||
this.visit_primary_bindings(
|
this.visit_primary_bindings(
|
||||||
pattern,
|
pattern,
|
||||||
|
@ -32,15 +32,19 @@ LL + if let E::Bar(identifier) = &s.x {
|
|||||||
|
|
|
|
||||||
|
|
||||||
error[E0507]: cannot move out of a shared reference
|
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 {
|
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
|
error: aborting due to 3 previous errors
|
||||||
|
|
||||||
|
@ -319,7 +319,6 @@ struct Testing {
|
|||||||
fn testing(a: &Testing) {
|
fn testing(a: &Testing) {
|
||||||
let Some(_s) = a.a else {
|
let Some(_s) = a.a else {
|
||||||
//~^ ERROR cannot move
|
//~^ ERROR cannot move
|
||||||
//~| HELP consider borrowing
|
|
||||||
return;
|
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
|
| 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
|
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 {
|
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
|
| data moved here
|
||||||
|
|
| move occurs because `_s` has type `String`, which does not implement the `Copy` trait
|
||||||
LL | let Some(&_s) = a.a else {
|
|
||||||
| +
|
|
||||||
|
|
||||||
error: aborting due to 61 previous errors
|
error: aborting due to 61 previous errors
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user