Skip to content
This repository was archived by the owner on Apr 5, 2024. It is now read-only.
This repository was archived by the owner on Apr 5, 2024. It is now read-only.

Move Upvar lowering from THIR to MIR #25

Closed
rust-lang/rust
#79149
@arora-aman

Description

@arora-aman

We lower paths that start from an Upvar here.

Essentially what this code does is convert upvars to refer to a field within the desugared ClosureSubsts. We want to refactor this code as follows:

  • Instead of doing the above desugaring we want to return Thir::Expr::UpvarRef(var_hir_id) in case the var_hir_id is mentioned within the closure. (This will allow us to deal with the let _ = x problem in MIR).
  • Move the logic currently in convert_var to rustc_mir_build/as_place
  • Maybe remove Thir::Expr::SelfRef, it's most likely only for Closures.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions