]> git.lizzy.rs Git - rust.git/commit - src/tools/rustfmt
Rollup merge of #79149 - sexxi-goose:upvar_ref, r=nikomatsakis
authorDylan DPC <dylan.dpc@gmail.com>
Thu, 19 Nov 2020 15:26:39 +0000 (16:26 +0100)
committerGitHub <noreply@github.com>
Thu, 19 Nov 2020 15:26:39 +0000 (16:26 +0100)
commit5c7d530b5ec520073f7388519f39033a7b342eef
tree3f10fb9bc32c224aa589ff3984c41f6fecfb8a83
parent62838c6b391768708ef260e27e82e9e05e11e046
parent9f70e782f7ee7c67c4ea693639c0e87b984d0234
Rollup merge of #79149 - sexxi-goose:upvar_ref, r=nikomatsakis

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`).

- 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.

Closes: rust-lang/project-rfc-2229#25
r? ```@nikomatsakis```