Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify E0507 to note Fn/FnMut relationship to borrowing #64330

Merged
merged 1 commit into from
Sep 10, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/librustc_mir/error_codes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1646,7 +1646,14 @@ fn print_fancy_ref(fancy_ref: &FancyNum){
"##,

E0507: r##"
You tried to move out of a value which was borrowed. Erroneous code example:
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.

Erroneous code example:

```compile_fail,E0507
use std::cell::RefCell;
Expand Down