Struct rustc_borrowck::constraint_generation::ConstraintGeneration [−][src]
struct ConstraintGeneration<'cg, 'cx, 'tcx> {
infcx: &'cg InferCtxt<'cx, 'tcx>,
all_facts: &'cg mut Option<AllFacts>,
location_table: &'cg LocationTable,
liveness_constraints: &'cg mut LivenessValues<RegionVid>,
borrow_set: &'cg BorrowSet<'tcx>,
body: &'cg Body<'tcx>,
}
Expand description
’cg = the duration of the constraint generation process itself.
Fields
infcx: &'cg InferCtxt<'cx, 'tcx>
all_facts: &'cg mut Option<AllFacts>
location_table: &'cg LocationTable
liveness_constraints: &'cg mut LivenessValues<RegionVid>
borrow_set: &'cg BorrowSet<'tcx>
body: &'cg Body<'tcx>
Implementations
fn add_regular_live_constraint<T>(&mut self, live_ty: T, location: Location) where
T: TypeFoldable<'tcx>,
fn add_regular_live_constraint<T>(&mut self, live_ty: T, location: Location) where
T: TypeFoldable<'tcx>,
Some variable with type live_ty
is “regular live” at
location
– i.e., it may be used later. This means that all
regions appearing in the type live_ty
must be live at
location
.
When recording facts for Polonius, records the borrows on the specified place
as killed
. For example, when assigning to a local, or on a call’s return destination.
Trait Implementations
We sometimes have substs
within an rvalue, or within a
call. Make them live at the location where they appear.
We sometimes have region
within an rvalue, or within a
call. Make them live at the location where they appear.
We sometimes have ty
within an rvalue, or within a
call. Make them live at the location where they appear.
fn visit_ascribe_user_ty(
&mut self,
_place: &Place<'tcx>,
_variance: &Variance,
_user_ty: &UserTypeProjection,
_location: Location
)
fn visit_projection(
&mut self,
place_ref: PlaceRef<'tcx>,
context: PlaceContext,
location: Location
)
fn visit_projection_elem(
&mut self,
local: Local,
proj_base: &[ProjectionElem<Local, &'tcx TyS<'tcx>>],
elem: ProjectionElem<Local, &'tcx TyS<'tcx>>,
context: PlaceContext,
location: Location
)
fn super_projection(
&mut self,
place_ref: PlaceRef<'tcx>,
context: PlaceContext,
location: Location
)
fn super_projection_elem(
&mut self,
_local: Local,
_proj_base: &[ProjectionElem<Local, &'tcx TyS<'tcx>>],
elem: ProjectionElem<Local, &'tcx TyS<'tcx>>,
_context: PlaceContext,
location: Location
)
fn visit_user_type_annotation(
&mut self,
index: UserTypeAnnotationIndex,
ty: &CanonicalUserTypeAnnotation<'tcx>
)
fn super_ascribe_user_ty(
&mut self,
place: &Place<'tcx>,
_variance: &Variance,
user_ty: &UserTypeProjection,
location: Location
)
fn super_user_type_annotation(
&mut self,
_index: UserTypeAnnotationIndex,
ty: &CanonicalUserTypeAnnotation<'tcx>
)
Auto Trait Implementations
impl<'cg, 'cx, 'tcx> !RefUnwindSafe for ConstraintGeneration<'cg, 'cx, 'tcx>
impl<'cg, 'cx, 'tcx> !Send for ConstraintGeneration<'cg, 'cx, 'tcx>
impl<'cg, 'cx, 'tcx> !Sync for ConstraintGeneration<'cg, 'cx, 'tcx>
impl<'cg, 'cx, 'tcx> Unpin for ConstraintGeneration<'cg, 'cx, 'tcx> where
'cx: 'cg,
'tcx: 'cg,
impl<'cg, 'cx, 'tcx> !UnwindSafe for ConstraintGeneration<'cg, 'cx, 'tcx>
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: 48 bytes