Struct rustc::middle::borrowck::move_data::MoveData[src]

pub struct MoveData {
    pub paths: RefCell<Vec<MovePath>>,
    pub path_map: RefCell<HashMap<Rc<LoanPath>, MovePathIndex>>,
    pub moves: RefCell<Vec<Move>>,
    pub var_assignments: RefCell<Vec<Assignment>>,
    pub path_assignments: RefCell<Vec<Assignment>>,
    pub assignee_ids: RefCell<HashSet<NodeId>>,
}

Fields

paths

Move paths. See section "Move paths" in doc.rs.

path_map

Cache of loan path to move path index, for easy lookup.

moves

Each move or uninitialized variable gets an entry here.

var_assignments

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

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

Assignments to a variable or path, like x = foo, but not x += foo.

Methods

impl MoveData

fn new() -> MoveData

fn move_path(&self, tcx: &ctxt, lp: Rc<LoanPath>) -> MovePathIndex

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 add_move(&self, tcx: &ctxt, lp: Rc<LoanPath>, id: NodeId, kind: MoveKind)

Adds a new move entry for a move of lp that occurs at location id with kind kind.

fn add_assignment(&self, tcx: &ctxt, lp: Rc<LoanPath>, assign_id: NodeId, span: Span, assignee_id: NodeId, mode: MutateMode)

Adds a new record for an assignment to lp that occurs at location id with the given span.