]> git.lizzy.rs Git - rust.git/commit
Move capture lowering from THIR to MIR
authorAman Arora <me@aman-arora.com>
Tue, 17 Nov 2020 06:52:14 +0000 (01:52 -0500)
committerAman Arora <me@aman-arora.com>
Tue, 17 Nov 2020 22:49:42 +0000 (17:49 -0500)
commit7faebe57b27f3005b5da8666bf02660b21fef4e2
tree54d288e05869115de61664585a14de3b970cbf8d
parentb5c37e86ff1782923e3abfbf5491dd383fcf827d
Move capture lowering from THIR to MIR

This allows us to:
- Handle precise Places captured by a closure directly in MIR. Handling
captures in MIR is easier since we can rely on/ tweak PlaceBuilder to
generate `mir::Place`s that resemble how we store captures (`hir::Place`).
- Allows us to handle `let _ = x` case when feature `capture_disjoint_fields`
is enabled directly in MIR. This is required to be done in MIR since
patterns are desugared in MIR.
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/expr/category.rs
compiler/rustc_mir_build/src/build/expr/into.rs
compiler/rustc_mir_build/src/thir/cx/expr.rs
compiler/rustc_mir_build/src/thir/cx/mod.rs
compiler/rustc_mir_build/src/thir/mod.rs