Never stop due to errors before borrow checking

This commit is contained in:
Esteban Küber
2019-04-15 12:54:18 -07:00
parent c21fbfe7e3
commit 6e723c24a8
49 changed files with 409 additions and 108 deletions

View File

@@ -5,5 +5,6 @@ pub fn main() {
// The below desugars to &(ref n, mut m).
for (n, mut m) in &tups {
//~^ ERROR cannot bind by-move and by-ref in the same pattern
//~| ERROR cannot move out of borrowed content
}
}

View File

@@ -6,6 +6,21 @@ LL | for (n, mut m) in &tups {
| |
| both by-ref and by-move used
error: aborting due to previous error
error[E0507]: cannot move out of borrowed content
--> $DIR/for.rs:6:23
|
LL | for (n, mut m) in &tups {
| ----- ^^^^^ cannot move out of borrowed content
| |
| data moved here
|
note: move occurs because `m` has type `Foo`, which does not implement the `Copy` trait
--> $DIR/for.rs:6:13
|
LL | for (n, mut m) in &tups {
| ^^^^^
For more information about this error, try `rustc --explain E0009`.
error: aborting due to 2 previous errors
Some errors have detailed explanations: E0009, E0507.
For more information about an error, try `rustc --explain E0009`.