Struct rustc_borrowck::borrowck::check_loans::CheckLoanCtxt [−][src]
struct CheckLoanCtxt<'a, 'tcx: 'a> {
bccx: &'a BorrowckCtxt<'a, 'tcx>,
dfcx_loans: &'a DataFlowContext<'a, 'tcx, LoanDataFlowOperator>,
move_data: &'a FlowedMoveData<'a, 'tcx>,
all_loans: &'a [Loan<'tcx>],
param_env: ParamEnv<'tcx>,
movable_generator: bool,
}🔬 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?
dfcx_loans: &'a DataFlowContext<'a, 'tcx, LoanDataFlowOperator>
🔬 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: &'a FlowedMoveData<'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?
all_loans: &'a [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?
param_env: ParamEnv<'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?
movable_generator: bool
🔬 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?
Methods
impl<'a, 'tcx> CheckLoanCtxt<'a, 'tcx>[src]
impl<'a, 'tcx> CheckLoanCtxt<'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?
pub fn each_issued_loan<F>(&self, node: ItemLocalId, op: F) -> bool where
F: FnMut(&Loan<'tcx>) -> bool, [src]
pub fn each_issued_loan<F>(&self, node: ItemLocalId, op: F) -> bool where
F: FnMut(&Loan<'tcx>) -> bool, 🔬 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?
Iterates over each loan that has been issued
on entrance to node, regardless of whether it is
actually in scope at that point. Sometimes loans
are issued for future scopes and thus they may have been
issued but not yet be in effect.
pub fn each_in_scope_loan<F>(&self, scope: Scope, op: F) -> bool where
F: FnMut(&Loan<'tcx>) -> bool, [src]
pub fn each_in_scope_loan<F>(&self, scope: Scope, op: F) -> bool where
F: FnMut(&Loan<'tcx>) -> bool, 🔬 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?
Like each_issued_loan(), but only considers loans that are
currently in scope.
fn each_in_scope_loan_affecting_path<F>(
&self,
scope: Scope,
loan_path: &LoanPath<'tcx>,
op: F
) -> bool where
F: FnMut(&Loan<'tcx>) -> bool, [src]
fn each_in_scope_loan_affecting_path<F>(
&self,
scope: Scope,
loan_path: &LoanPath<'tcx>,
op: F
) -> bool where
F: FnMut(&Loan<'tcx>) -> bool, 🔬 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?
Iterates through all of the in-scope loans affecting loan_path,
calling op, and ceasing iteration if false is returned.
pub fn loans_generated_by(&self, node: ItemLocalId) -> Vec<usize>[src]
pub fn loans_generated_by(&self, node: ItemLocalId) -> Vec<usize>🔬 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?
Returns a vector of the loans that are generated as
we enter node.
pub fn check_for_loans_across_yields(
&self,
cmt: &cmt_<'tcx>,
loan_region: Region<'tcx>,
borrow_span: Span
)[src]
pub fn check_for_loans_across_yields(
&self,
cmt: &cmt_<'tcx>,
loan_region: Region<'tcx>,
borrow_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?
pub fn check_for_conflicting_loans(&self, node: ItemLocalId)[src]
pub fn check_for_conflicting_loans(&self, node: ItemLocalId)🔬 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?
Checks to see whether any of the loans that are issued
on entrance to node conflict with loans that have already been
issued when we enter node (for example, we do not
permit two &mut borrows of the same variable).
(Note that some loans can be issued without necessarily taking effect yet.)
pub fn report_error_if_loans_conflict(
&self,
old_loan: &Loan<'tcx>,
new_loan: &Loan<'tcx>
) -> bool[src]
pub fn report_error_if_loans_conflict(
&self,
old_loan: &Loan<'tcx>,
new_loan: &Loan<'tcx>
) -> bool🔬 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?
Checks whether old_loan and new_loan can safely be issued
simultaneously.
pub fn report_error_if_loan_conflicts_with_restriction(
&self,
loan1: &Loan<'tcx>,
loan2: &Loan<'tcx>,
old_loan: &Loan<'tcx>,
new_loan: &Loan<'tcx>
) -> Result<(), DiagnosticBuilder<'a>>[src]
pub fn report_error_if_loan_conflicts_with_restriction(
&self,
loan1: &Loan<'tcx>,
loan2: &Loan<'tcx>,
old_loan: &Loan<'tcx>,
new_loan: &Loan<'tcx>
) -> Result<(), DiagnosticBuilder<'a>>🔬 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?
Checks whether the restrictions introduced by loan1 would
prohibit loan2. Returns false if an error is reported.
fn consume_common(
&self,
id: ItemLocalId,
span: Span,
cmt: &cmt_<'tcx>,
mode: ConsumeMode
)[src]
fn consume_common(
&self,
id: ItemLocalId,
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 check_for_copy_of_frozen_path(
&self,
id: ItemLocalId,
span: Span,
copy_path: &LoanPath<'tcx>
)[src]
fn check_for_copy_of_frozen_path(
&self,
id: ItemLocalId,
span: Span,
copy_path: &LoanPath<'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 check_for_move_of_borrowed_path(
&self,
id: ItemLocalId,
span: Span,
move_path: &LoanPath<'tcx>,
move_kind: MoveKind
)[src]
fn check_for_move_of_borrowed_path(
&self,
id: ItemLocalId,
span: Span,
move_path: &LoanPath<'tcx>,
move_kind: MoveKind
)🔬 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?
pub fn analyze_restrictions_on_use(
&self,
expr_id: ItemLocalId,
use_path: &LoanPath<'tcx>,
borrow_kind: BorrowKind
) -> UseError<'tcx>[src]
pub fn analyze_restrictions_on_use(
&self,
expr_id: ItemLocalId,
use_path: &LoanPath<'tcx>,
borrow_kind: BorrowKind
) -> UseError<'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 check_if_path_is_moved(
&self,
id: ItemLocalId,
span: Span,
use_kind: MovedValueUseKind,
lp: &Rc<LoanPath<'tcx>>
)[src]
fn check_if_path_is_moved(
&self,
id: ItemLocalId,
span: Span,
use_kind: MovedValueUseKind,
lp: &Rc<LoanPath<'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?
Reports an error if expr (which should be a path)
is using a moved/uninitialized value
fn check_if_assigned_path_is_moved(
&self,
id: ItemLocalId,
span: Span,
use_kind: MovedValueUseKind,
lp: &Rc<LoanPath<'tcx>>
)[src]
fn check_if_assigned_path_is_moved(
&self,
id: ItemLocalId,
span: Span,
use_kind: MovedValueUseKind,
lp: &Rc<LoanPath<'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?
Reports an error if assigning to lp will use a
moved/uninitialized value. Mainly this is concerned with
detecting derefs of uninitialized pointers.
For example:
let a: i32; a = 10; // ok, even though a is uninitialized
struct Point { x: u32, y: u32 } let mut p: Point; p.x = 22; // ok, even though `p` is uninitialized
let mut p: Box<Point>; (*p).x = 22; // not ok, p is uninitialized, can't deref
fn check_assignment(
&self,
assignment_id: ItemLocalId,
assignment_span: Span,
assignee_cmt: &cmt_<'tcx>
)[src]
fn check_assignment(
&self,
assignment_id: ItemLocalId,
assignment_span: Span,
assignee_cmt: &cmt_<'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?
pub fn report_illegal_mutation(
&self,
span: Span,
loan_path: &LoanPath<'tcx>,
loan: &Loan
)[src]
pub fn report_illegal_mutation(
&self,
span: Span,
loan_path: &LoanPath<'tcx>,
loan: &Loan
)🔬 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 CheckLoanCtxt<'a, 'tcx>[src]
impl<'a, 'tcx> Delegate<'tcx> for CheckLoanCtxt<'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_, _mode: MatchMode)[src]
fn matched_pat(&mut self, _matched_pat: &Pat, _cmt: &cmt_, _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 CheckLoanCtxt<'a, 'tcx>
impl<'a, 'tcx> !Send for CheckLoanCtxt<'a, 'tcx>impl<'a, 'tcx> !Sync for CheckLoanCtxt<'a, 'tcx>
impl<'a, 'tcx> !Sync for CheckLoanCtxt<'a, 'tcx>