Struct rustc_const_eval::transform::promote_consts::Promoter
source · [−]struct Promoter<'a, 'tcx> {
tcx: TyCtxt<'tcx>,
source: &'a mut Body<'tcx>,
promoted: Body<'tcx>,
temps: &'a mut IndexVec<Local, TempState>,
extra_statements: &'a mut Vec<(Location, Statement<'tcx>)>,
keep_original: bool,
}Fields
tcx: TyCtxt<'tcx>source: &'a mut Body<'tcx>promoted: Body<'tcx>temps: &'a mut IndexVec<Local, TempState>extra_statements: &'a mut Vec<(Location, Statement<'tcx>)>keep_original: boolIf true, all nested temps are also kept in the source MIR, not moved to the promoted MIR.
Implementations
Copies the initialization of this temp to the promoted MIR, recursing through temps.
Trait Implementations
Replaces all temporaries with their promoted counterparts.
fn visit_ascribe_user_ty(
&mut self,
place: &mut Place,
variance: &mut Variance,
user_ty: &mut UserTypeProjection,
location: Location
)
fn process_projection(
&mut self,
projection: &'a [ProjectionElem<Local, &TyS>],
location: Location
) -> Option<Vec<ProjectionElem<Local, &TyS>, Global>>
fn process_projection_elem(
&mut self,
elem: ProjectionElem<Local, &TyS>,
location: Location
) -> Option<ProjectionElem<Local, &TyS>>
fn visit_user_type_annotation(
&mut self,
index: UserTypeAnnotationIndex,
ty: &mut CanonicalUserTypeAnnotation
)
fn super_ascribe_user_ty(
&mut self,
place: &mut Place,
_variance: &mut Variance,
user_ty: &mut UserTypeProjection,
location: Location
)
fn super_user_type_annotation(
&mut self,
_index: UserTypeAnnotationIndex,
ty: &mut CanonicalUserTypeAnnotation
)
Auto Trait Implementations
impl<'a, 'tcx> !RefUnwindSafe for Promoter
impl<'a, 'tcx> !UnwindSafe for Promoter
Blanket Implementations
Layout
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.
Size: 272 bytes