1
Fork 0

Move mir::Fieldabi::FieldIdx

The first PR for https://github.com/rust-lang/compiler-team/issues/606

This is just the move-and-rename, because it's plenty big-and-bitrotty already.  Future PRs will start using `FieldIdx` more broadly, and concomitantly removing `FieldIdx::new`s.
This commit is contained in:
Scott McMurray 2023-03-28 12:32:57 -07:00
parent acd27bb557
commit 5bbaeadc01
46 changed files with 192 additions and 157 deletions

View file

@ -25,6 +25,7 @@ use rustc_middle::ty::{self, Ty, TyCtxt, TypeVisitableExt};
use rustc_span::symbol::sym;
use rustc_span::Span;
use rustc_span::Symbol;
use rustc_target::abi::FieldIdx;
use rustc_target::spec::abi::Abi;
use super::lints;
@ -793,7 +794,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
let mutability = captured_place.mutability;
let mut projs = closure_env_projs.clone();
projs.push(ProjectionElem::Field(Field::new(i), ty));
projs.push(ProjectionElem::Field(FieldIdx::new(i), ty));
match capture {
ty::UpvarCapture::ByValue => {}
ty::UpvarCapture::ByRef(..) => {