Skip to content

Commit

Permalink
Rollup merge of rust-lang#70883 - GuillaumeGomez:cleanup-e0507, r=Dyl…
Browse files Browse the repository at this point in the history
…an-DPC

Clean up E0507 explanation

r? @Dylan-DPC
  • Loading branch information
Dylan-DPC authored Apr 8, 2020
2 parents e97a6e7 + 6569a2e commit 6696666
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/librustc_error_codes/error_codes/E0507.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
You tried to move out of a value which was borrowed.

This can also happen when using a type implementing `Fn` or `FnMut`, as neither
allows moving out of them (they usually represent closures which can be called
more than once). Much of the text following applies equally well to non-`FnOnce`
closure bodies.
A borrowed value was moved out.

Erroneous code example:

Expand Down Expand Up @@ -32,6 +27,11 @@ you have three choices:
* Somehow reclaim the ownership.
* Implement the `Copy` trait on the type.

This can also happen when using a type implementing `Fn` or `FnMut`, as neither
allows moving out of them (they usually represent closures which can be called
more than once). Much of the text following applies equally well to non-`FnOnce`
closure bodies.

Examples:

```
Expand Down

0 comments on commit 6696666

Please sign in to comment.