Struct rustc_borrowck::borrowck::move_data::MoveData [−][src]
pub struct MoveData<'tcx> {
pub paths: RefCell<Vec<MovePath<'tcx>>>,
pub path_map: RefCell<FxHashMap<Rc<LoanPath<'tcx>>, MovePathIndex>>,
pub moves: RefCell<Vec<Move>>,
pub var_assignments: RefCell<Vec<Assignment>>,
pub path_assignments: RefCell<Vec<Assignment>>,
pub assignee_ids: RefCell<FxHashSet<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?
Fields
paths: RefCell<Vec<MovePath<'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 paths. See section "Move paths" in README.md.
path_map: RefCell<FxHashMap<Rc<LoanPath<'tcx>>, MovePathIndex>>
🔬 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?
Cache of loan path to move path index, for easy lookup.
moves: RefCell<Vec<Move>>
🔬 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?
Each move or uninitialized variable gets an entry here.
var_assignments: RefCell<Vec<Assignment>>
🔬 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?
Assignments to a variable, like x = foo. These are assigned
bits for dataflow, since we must track them to ensure that
immutable variables are assigned at most once along each path.
path_assignments: RefCell<Vec<Assignment>>
🔬 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?
Assignments to a path, like x.f = foo. These are not
assigned dataflow bits, but we track them because they still
kill move bits.
assignee_ids: RefCell<FxHashSet<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?
Assignments to a variable or path, like x = foo, but not x += foo.
Methods
impl<'a, 'tcx> MoveData<'tcx>[src]
impl<'a, 'tcx> MoveData<'tcx>pub fn is_empty(&self) -> bool[src]
pub fn is_empty(&self) -> 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?
return true if there are no trackable assignments or moves in this move data - that means that there is nothing that could cause a borrow error.
pub fn path_loan_path(&self, index: MovePathIndex) -> Rc<LoanPath<'tcx>>[src]
pub fn path_loan_path(&self, index: MovePathIndex) -> 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?
fn path_parent(&self, index: MovePathIndex) -> MovePathIndex[src]
fn path_parent(&self, index: MovePathIndex) -> MovePathIndex🔬 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 path_first_move(&self, index: MovePathIndex) -> MoveIndex[src]
fn path_first_move(&self, index: MovePathIndex) -> MoveIndex🔬 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 path_first_child(&self, index: MovePathIndex) -> MovePathIndex[src]
fn path_first_child(&self, index: MovePathIndex) -> MovePathIndex🔬 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 the index of first child, or InvalidMovePathIndex if
index is leaf.
fn path_next_sibling(&self, index: MovePathIndex) -> MovePathIndex[src]
fn path_next_sibling(&self, index: MovePathIndex) -> MovePathIndex🔬 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 set_path_first_move(&self, index: MovePathIndex, first_move: MoveIndex)[src]
fn set_path_first_move(&self, index: MovePathIndex, first_move: MoveIndex)🔬 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 set_path_first_child(&self, index: MovePathIndex, first_child: MovePathIndex)[src]
fn set_path_first_child(&self, index: MovePathIndex, first_child: MovePathIndex)🔬 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 move_next_move(&self, index: MoveIndex) -> MoveIndex[src]
fn move_next_move(&self, index: MoveIndex) -> MoveIndex🔬 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?
Type safe indexing operator
fn is_var_path(&self, index: MovePathIndex) -> bool[src]
fn is_var_path(&self, index: MovePathIndex) -> 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?
True if index refers to a variable
pub fn move_path(
&self,
tcx: TyCtxt<'a, 'tcx, 'tcx>,
lp: Rc<LoanPath<'tcx>>
) -> MovePathIndex[src]
pub fn move_path(
&self,
tcx: TyCtxt<'a, 'tcx, 'tcx>,
lp: Rc<LoanPath<'tcx>>
) -> MovePathIndex🔬 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 the existing move path index for lp, if any, and otherwise adds a new index for
lp and any of its base paths that do not yet have an index.
fn existing_move_path(&self, lp: &Rc<LoanPath<'tcx>>) -> Option<MovePathIndex>[src]
fn existing_move_path(&self, lp: &Rc<LoanPath<'tcx>>) -> Option<MovePathIndex>🔬 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 existing_base_paths(&self, lp: &Rc<LoanPath<'tcx>>) -> Vec<MovePathIndex>[src]
fn existing_base_paths(&self, lp: &Rc<LoanPath<'tcx>>) -> Vec<MovePathIndex>🔬 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 add_existing_base_paths(
&self,
lp: &Rc<LoanPath<'tcx>>,
result: &mut Vec<MovePathIndex>
)[src]
fn add_existing_base_paths(
&self,
lp: &Rc<LoanPath<'tcx>>,
result: &mut Vec<MovePathIndex>
)🔬 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?
Adds any existing move path indices for lp and any base paths of lp to result, but
does not add new move paths
pub fn add_move(
&self,
tcx: TyCtxt<'a, 'tcx, 'tcx>,
orig_lp: Rc<LoanPath<'tcx>>,
id: ItemLocalId,
kind: MoveKind
)[src]
pub fn add_move(
&self,
tcx: TyCtxt<'a, 'tcx, 'tcx>,
orig_lp: Rc<LoanPath<'tcx>>,
id: ItemLocalId,
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?
Adds a new move entry for a move of lp that occurs at location id with kind kind.
fn add_move_helper(
&self,
tcx: TyCtxt<'a, 'tcx, 'tcx>,
lp: Rc<LoanPath<'tcx>>,
id: ItemLocalId,
kind: MoveKind
)[src]
fn add_move_helper(
&self,
tcx: TyCtxt<'a, 'tcx, 'tcx>,
lp: Rc<LoanPath<'tcx>>,
id: ItemLocalId,
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 add_assignment(
&self,
tcx: TyCtxt<'a, 'tcx, 'tcx>,
lp: Rc<LoanPath<'tcx>>,
assign_id: ItemLocalId,
span: Span,
assignee_id: ItemLocalId,
mode: MutateMode
)[src]
pub fn add_assignment(
&self,
tcx: TyCtxt<'a, 'tcx, 'tcx>,
lp: Rc<LoanPath<'tcx>>,
assign_id: ItemLocalId,
span: Span,
assignee_id: ItemLocalId,
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?
Adds a new record for an assignment to lp that occurs at location id with the given
span.
fn add_assignment_helper(
&self,
tcx: TyCtxt<'a, 'tcx, 'tcx>,
lp: Rc<LoanPath<'tcx>>,
assign_id: ItemLocalId,
span: Span,
assignee_id: ItemLocalId,
mode: MutateMode
)[src]
fn add_assignment_helper(
&self,
tcx: TyCtxt<'a, 'tcx, 'tcx>,
lp: Rc<LoanPath<'tcx>>,
assign_id: ItemLocalId,
span: Span,
assignee_id: ItemLocalId,
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 add_gen_kills(
&self,
bccx: &BorrowckCtxt<'a, 'tcx>,
dfcx_moves: &mut DataFlowContext<'a, 'tcx, MoveDataFlowOperator>,
dfcx_assign: &mut DataFlowContext<'a, 'tcx, AssignDataFlowOperator>
)[src]
fn add_gen_kills(
&self,
bccx: &BorrowckCtxt<'a, 'tcx>,
dfcx_moves: &mut DataFlowContext<'a, 'tcx, MoveDataFlowOperator>,
dfcx_assign: &mut DataFlowContext<'a, 'tcx, AssignDataFlowOperator>
)🔬 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?
Adds the gen/kills for the various moves and
assignments into the provided data flow contexts.
Moves are generated by moves and killed by assignments and
scoping. Assignments are generated by assignment to variables and
killed by scoping. See README.md for more details.
fn each_base_path<F>(&self, index: MovePathIndex, f: F) -> bool where
F: FnMut(MovePathIndex) -> bool, [src]
fn each_base_path<F>(&self, index: MovePathIndex, f: F) -> bool where
F: FnMut(MovePathIndex) -> 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?
fn each_extending_path_<F>(&self, index: MovePathIndex, f: &mut F) -> bool where
F: FnMut(MovePathIndex) -> bool, [src]
fn each_extending_path_<F>(&self, index: MovePathIndex, f: &mut F) -> bool where
F: FnMut(MovePathIndex) -> 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?
fn each_extending_path<F>(&self, index: MovePathIndex, f: F) -> bool where
F: FnMut(MovePathIndex) -> bool, [src]
fn each_extending_path<F>(&self, index: MovePathIndex, f: F) -> bool where
F: FnMut(MovePathIndex) -> 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?
fn each_applicable_move<F>(&self, index0: MovePathIndex, f: F) -> bool where
F: FnMut(MoveIndex) -> bool, [src]
fn each_applicable_move<F>(&self, index0: MovePathIndex, f: F) -> bool where
F: FnMut(MoveIndex) -> 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?
fn kill_moves(
&self,
path: MovePathIndex,
kill_id: ItemLocalId,
kill_kind: KillFrom,
dfcx_moves: &mut DataFlowContext<'a, 'tcx, MoveDataFlowOperator>
)[src]
fn kill_moves(
&self,
path: MovePathIndex,
kill_id: ItemLocalId,
kill_kind: KillFrom,
dfcx_moves: &mut DataFlowContext<'a, 'tcx, MoveDataFlowOperator>
)🔬 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?