]> git.lizzy.rs Git - rust.git/commit
Use precise places when lowering Closures in THIR
authorAman Arora <me@aman-arora.com>
Thu, 26 Nov 2020 05:07:41 +0000 (00:07 -0500)
committerAman Arora <me@aman-arora.com>
Thu, 10 Dec 2020 03:34:15 +0000 (22:34 -0500)
commite2efdd156bf6915d6831821ff8a263e43e493e32
treed892ad6c043569b9c2d9111f9093cfa6011c4751
parent6a1d0699a484ee875c87394f70cb37f09acadd88
Use precise places when lowering Closures in THIR

- Closures now use closure_min_captures to figure out captured paths
- Build upvar_mutbls using closure_min_captures
- Change logic in limit_capture_mutability to differentiate b/w
  capturing parent's local variable or capturing a variable that is
  captured by the parent (in case of nested closure) using PlaceBase.

Co-authored-by: Roxane Fruytier <roxane.fruytier@hotmail.com>
compiler/rustc_mir_build/src/build/expr/as_place.rs
compiler/rustc_mir_build/src/build/expr/as_rvalue.rs
compiler/rustc_mir_build/src/build/mod.rs
compiler/rustc_mir_build/src/thir/cx/expr.rs