-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Clean up E0501 explanation #70690
Clean up E0501 explanation #70690
Conversation
on [Capturing][capturing] in Rust By Example for more information. | ||
|
||
[capturing]: https://doc.rust-lang.org/stable/rust-by-example/fn/closures/capture.html | ||
A mutable variable is being used whereas it has already been captured by a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A mutable variable is being used whereas it has already been captured by a | |
A mutable variable is used but it is already captured by a closure. |
|
||
[capturing]: https://doc.rust-lang.org/stable/rust-by-example/fn/closures/capture.html | ||
A mutable variable is being used whereas it has already been captured by a | ||
closure. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
closure. |
@@ -29,6 +22,16 @@ fn foo(a: &mut i32) { | |||
} | |||
``` | |||
|
|||
This error indicates that a mutable variable is being used while it is still |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error indicates that a mutable variable is being used while it is still | |
This error indicates that a mutable variable is used while it is still |
@@ -29,6 +22,16 @@ fn foo(a: &mut i32) { | |||
} | |||
``` | |||
|
|||
This error indicates that a mutable variable is being used while it is still | |||
captured by a closure. Because the closure has borrowed the variable, it is not | |||
available for use until the closure goes out of scope. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
available for use until the closure goes out of scope. | |
available till the closure goes out of scope. |
010ae69
to
f80a380
Compare
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
f80a380
to
84c97ee
Compare
@bors r+ rollup |
📌 Commit 84c97ee has been approved by |
…an-DPC Clean up E0501 explanation r? @Dylan-DPC
Rollup of 5 pull requests Successful merges: - rust-lang#70612 (Add io::Write::write_all_vectored) - rust-lang#70690 (Clean up E0501 explanation) - rust-lang#70821 (expose suggestions::InferCtxtExt for clippy) - rust-lang#70839 (clean up E0506 explanation) - rust-lang#70859 (Move sanitize-inline-always test to sanitize directory) Failed merges: r? @ghost
r? @Dylan-DPC