Struct rustc_borrowck::borrowck::gather_loans::GatherLoanCtxt [−][src]
struct GatherLoanCtxt<'a, 'tcx: 'a> { bccx: &'a BorrowckCtxt<'a, 'tcx>, move_data: MoveData<'tcx>, move_error_collector: MoveErrorCollector<'tcx>, all_loans: Vec<Loan<'tcx>>, item_ub: Scope, }
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Fields
bccx: &'a BorrowckCtxt<'a, 'tcx>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
move_data: MoveData<'tcx>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
move_error_collector: MoveErrorCollector<'tcx>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
all_loans: Vec<Loan<'tcx>>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
item_ub: Scope
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
item_ub
is used as an upper-bound on the lifetime whenever we
ask for the scope of an expression categorized as an upvar.
Methods
impl<'a, 'tcx> GatherLoanCtxt<'a, 'tcx>
[src]
impl<'a, 'tcx> GatherLoanCtxt<'a, 'tcx>
pub fn tcx(&self) -> TyCtxt<'a, 'tcx, 'tcx>
[src]
pub fn tcx(&self) -> TyCtxt<'a, 'tcx, 'tcx>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn guarantee_assignment_valid(
&mut self,
assignment_id: NodeId,
assignment_span: Span,
cmt: &cmt_<'tcx>,
mode: MutateMode
)
[src]
fn guarantee_assignment_valid(
&mut self,
assignment_id: NodeId,
assignment_span: Span,
cmt: &cmt_<'tcx>,
mode: MutateMode
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Guarantees that cmt
is assignable, or reports an error.
fn guarantee_valid(
&mut self,
borrow_id: ItemLocalId,
borrow_span: Span,
cmt: &cmt_<'tcx>,
req_kind: BorrowKind,
loan_region: Region<'tcx>,
cause: LoanCause
)
[src]
fn guarantee_valid(
&mut self,
borrow_id: ItemLocalId,
borrow_span: Span,
cmt: &cmt_<'tcx>,
req_kind: BorrowKind,
loan_region: Region<'tcx>,
cause: LoanCause
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Guarantees that addr_of(cmt)
will be valid for the duration of static_scope_r
, or
reports an error. This may entail taking out loans, which will be added to the
req_loan_map
.
pub fn mark_loan_path_as_mutated(&self, loan_path: &LoanPath)
[src]
pub fn mark_loan_path_as_mutated(&self, loan_path: &LoanPath)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
For mutable loans of content whose mutability derives from a local variable, mark the mutability decl as necessary.
pub fn compute_gen_scope(&self, borrow_scope: Scope, loan_scope: Scope) -> Scope
[src]
pub fn compute_gen_scope(&self, borrow_scope: Scope, loan_scope: Scope) -> Scope
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Determine when to introduce the loan. Typically the loan is introduced at the point of the borrow, but in some cases, notably method arguments, the loan may be introduced only later, once it comes into scope.
pub fn compute_kill_scope(
&self,
loan_scope: Scope,
lp: &LoanPath<'tcx>
) -> Scope
[src]
pub fn compute_kill_scope(
&self,
loan_scope: Scope,
lp: &LoanPath<'tcx>
) -> Scope
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Determine when the loan restrictions go out of scope. This is either when the lifetime expires or when the local variable which roots the loan-path goes out of scope, whichever happens faster.
It may seem surprising that we might have a loan region
larger than the variable which roots the loan-path; this can
come about when variables of &mut
type are re-borrowed,
as in this example:
struct Foo { counter: u32 } fn counter<'a>(v: &'a mut Foo) -> &'a mut u32 { &mut v.counter }
In this case, the reference ('a
) outlives the
variable v
that hosts it. Note that this doesn't come up
with immutable &
pointers, because borrows of such pointers
do not require restrictions and hence do not cause a loan.
pub fn report_potential_errors(&self)
[src]
pub fn report_potential_errors(&self)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Trait Implementations
impl<'a, 'tcx> Delegate<'tcx> for GatherLoanCtxt<'a, 'tcx>
[src]
impl<'a, 'tcx> Delegate<'tcx> for GatherLoanCtxt<'a, 'tcx>
fn consume(
&mut self,
consume_id: NodeId,
_consume_span: Span,
cmt: &cmt_<'tcx>,
mode: ConsumeMode
)
[src]
fn consume(
&mut self,
consume_id: NodeId,
_consume_span: Span,
cmt: &cmt_<'tcx>,
mode: ConsumeMode
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn matched_pat(&mut self, matched_pat: &Pat, cmt: &cmt_<'tcx>, mode: MatchMode)
[src]
fn matched_pat(&mut self, matched_pat: &Pat, cmt: &cmt_<'tcx>, mode: MatchMode)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn consume_pat(
&mut self,
consume_pat: &Pat,
cmt: &cmt_<'tcx>,
mode: ConsumeMode
)
[src]
fn consume_pat(
&mut self,
consume_pat: &Pat,
cmt: &cmt_<'tcx>,
mode: ConsumeMode
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn borrow(
&mut self,
borrow_id: NodeId,
borrow_span: Span,
cmt: &cmt_<'tcx>,
loan_region: Region<'tcx>,
bk: BorrowKind,
loan_cause: LoanCause
)
[src]
fn borrow(
&mut self,
borrow_id: NodeId,
borrow_span: Span,
cmt: &cmt_<'tcx>,
loan_region: Region<'tcx>,
bk: BorrowKind,
loan_cause: LoanCause
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn mutate(
&mut self,
assignment_id: NodeId,
assignment_span: Span,
assignee_cmt: &cmt_<'tcx>,
mode: MutateMode
)
[src]
fn mutate(
&mut self,
assignment_id: NodeId,
assignment_span: Span,
assignee_cmt: &cmt_<'tcx>,
mode: MutateMode
)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn decl_without_init(&mut self, id: NodeId, _span: Span)
[src]
fn decl_without_init(&mut self, id: NodeId, _span: Span)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Auto Trait Implementations
impl<'a, 'tcx> !Send for GatherLoanCtxt<'a, 'tcx>
impl<'a, 'tcx> !Send for GatherLoanCtxt<'a, 'tcx>
impl<'a, 'tcx> !Sync for GatherLoanCtxt<'a, 'tcx>
impl<'a, 'tcx> !Sync for GatherLoanCtxt<'a, 'tcx>