[refactoring] MIR stores the return_ty
field in two places!
#46001
Labels
C-cleanup
Category: PRs that clean code up or issues documenting cleanup.
E-easy
Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
E-mentor
Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Right now, the MIR has a special field,
return_ty
:rust/src/librustc/mir/mod.rs
Lines 85 to 86 in f93a492
However, the MIR also has an array of locals, and the 0th local is the "return slot". Its type is the return type:
rust/src/librustc/mir/mod.rs
Lines 97 to 102 in f93a492
It would be nice to eliminate the redundancy. My preference would be to remove the
return_ty
field, perhaps adding an accessor toMir<'tcx>
like:The text was updated successfully, but these errors were encountered: