forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tweak mem categorization of upvar mutability
- Correctly categorize env pointer deref for `FnMut` as declared rather than inherited. This fixes an assert in borrowck. Closes rust-lang#18238 - Categorize env pointer deref as mutable only if the closure is `FnMut` *and* the original variable is declared mutable. This disallows capture-by-value `FnMut` closures from mutating captured variables that aren't declared mutable. This is a difference from the equivalent desugared code which would permit it, but it is consistent with the behavior of procs. Closes rust-lang#18335 - Avoid computing info about the env pointer if there isn't one.
- Loading branch information
Showing
1 changed file
with
69 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters