[−][src]Struct rustc_mir::dataflow::impls::borrows::Borrows
Borrows
stores the data used in the analyses that track the flow
of borrows.
It uniquely identifies every borrow (Rvalue::Ref
) by a
BorrowIndex
, and maps each such index to a BorrowData
describing the borrow. These indexes are used for representing the
borrows in compact bitvectors.
Fields
tcx: TyCtxt<'tcx>
body: &'a Body<'tcx>
borrow_set: Rc<BorrowSet<'tcx>>
borrows_out_of_scope_at_location: FxHashMap<Location, Vec<BorrowIndex>>
_nonlexical_regioncx: Rc<RegionInferenceContext<'tcx>>
NLL region inference context with which NLL queries should be resolved
Implementations
impl<'a, 'tcx> Borrows<'a, 'tcx>
[src]
pub(crate) fn new(
tcx: TyCtxt<'tcx>,
body: &'a Body<'tcx>,
nonlexical_regioncx: Rc<RegionInferenceContext<'tcx>>,
borrow_set: &Rc<BorrowSet<'tcx>>
) -> Self
[src]
tcx: TyCtxt<'tcx>,
body: &'a Body<'tcx>,
nonlexical_regioncx: Rc<RegionInferenceContext<'tcx>>,
borrow_set: &Rc<BorrowSet<'tcx>>
) -> Self
pub fn location(&self, idx: BorrowIndex) -> &Location
[src]
fn kill_loans_out_of_scope_at_location(
&self,
trans: &mut impl GenKill<BorrowIndex>,
location: Location
)
[src]
&self,
trans: &mut impl GenKill<BorrowIndex>,
location: Location
)
Add all borrows to the kill set, if those borrows are out of scope at location
.
That means they went out of a nonlexical scope
fn kill_borrows_on_place(
&self,
trans: &mut impl GenKill<BorrowIndex>,
place: Place<'tcx>
)
[src]
&self,
trans: &mut impl GenKill<BorrowIndex>,
place: Place<'tcx>
)
Kill any borrows that conflict with place
.
Trait Implementations
impl<'tcx> AnalysisDomain<'tcx> for Borrows<'_, 'tcx>
[src]
type Domain = BitSet<BorrowIndex>
The type that holds the dataflow state at any given point in the program.
pub const NAME: &'static str
[src]
pub fn bottom_value(&self, _: &Body<'tcx>) -> Self::Domain
[src]
pub fn initialize_start_block(&self, _: &Body<'tcx>, _: &mut Self::Domain)
[src]
type Direction: Direction = Forward
impl DebugWithContext<Borrows<'_, '_>> for BorrowIndex
[src]
pub fn fmt_with(&self, ctxt: &Borrows<'_, '_>, f: &mut Formatter<'_>) -> Result
[src]
pub fn fmt_diff_with(
&self,
old: &Self,
ctxt: &C,
f: &mut Formatter<'_>
) -> Result
[src]
&self,
old: &Self,
ctxt: &C,
f: &mut Formatter<'_>
) -> Result
impl<'tcx> GenKillAnalysis<'tcx> for Borrows<'_, 'tcx>
[src]
type Idx = BorrowIndex
pub fn before_statement_effect(
&self,
trans: &mut impl GenKill<Self::Idx>,
_statement: &Statement<'tcx>,
location: Location
)
[src]
&self,
trans: &mut impl GenKill<Self::Idx>,
_statement: &Statement<'tcx>,
location: Location
)
pub fn statement_effect(
&self,
trans: &mut impl GenKill<Self::Idx>,
stmt: &Statement<'tcx>,
location: Location
)
[src]
&self,
trans: &mut impl GenKill<Self::Idx>,
stmt: &Statement<'tcx>,
location: Location
)
pub fn before_terminator_effect(
&self,
trans: &mut impl GenKill<Self::Idx>,
_terminator: &Terminator<'tcx>,
location: Location
)
[src]
&self,
trans: &mut impl GenKill<Self::Idx>,
_terminator: &Terminator<'tcx>,
location: Location
)
pub fn terminator_effect(
&self,
trans: &mut impl GenKill<Self::Idx>,
teminator: &Terminator<'tcx>,
_location: Location
)
[src]
&self,
trans: &mut impl GenKill<Self::Idx>,
teminator: &Terminator<'tcx>,
_location: Location
)
pub fn call_return_effect(
&self,
_trans: &mut impl GenKill<Self::Idx>,
_block: BasicBlock,
_func: &Operand<'tcx>,
_args: &[Operand<'tcx>],
_dest_place: Place<'tcx>
)
[src]
&self,
_trans: &mut impl GenKill<Self::Idx>,
_block: BasicBlock,
_func: &Operand<'tcx>,
_args: &[Operand<'tcx>],
_dest_place: Place<'tcx>
)
pub fn yield_resume_effect(
&self,
_trans: &mut impl GenKill<Self::Idx>,
_resume_block: BasicBlock,
_resume_place: Place<'tcx>
)
[src]
&self,
_trans: &mut impl GenKill<Self::Idx>,
_resume_block: BasicBlock,
_resume_place: Place<'tcx>
)
pub fn switch_int_edge_effects<G: GenKill<Self::Idx>>(
&self,
_block: BasicBlock,
_discr: &Operand<'tcx>,
_edge_effects: &mut impl SwitchIntEdgeEffects<G>
)
[src]
&self,
_block: BasicBlock,
_discr: &Operand<'tcx>,
_edge_effects: &mut impl SwitchIntEdgeEffects<G>
)
Auto Trait Implementations
impl<'a, 'tcx> !RefUnwindSafe for Borrows<'a, 'tcx>
[src]
impl<'a, 'tcx> !Send for Borrows<'a, 'tcx>
[src]
impl<'a, 'tcx> !Sync for Borrows<'a, 'tcx>
[src]
impl<'a, 'tcx> Unpin for Borrows<'a, 'tcx> where
'tcx: 'a,
[src]
'tcx: 'a,
impl<'a, 'tcx> !UnwindSafe for Borrows<'a, 'tcx>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.