Struct rustc_trans::middle::borrowck::move_data::MoveDataExperimental [-]  [+] [src]

pub struct MoveData<'tcx> {
    pub paths: RefCell<Vec<MovePath<'tcx>>>,
    pub path_map: RefCell<HashMap<Rc<LoanPath<'tcx>>, MovePathIndex, FnvHasher>>,
    pub moves: RefCell<Vec<Move>>,
    pub var_assignments: RefCell<Vec<Assignment>>,
    pub path_assignments: RefCell<Vec<Assignment>>,
    pub variant_matches: RefCell<Vec<VariantMatch>>,
    pub assignee_ids: RefCell<HashSet<u32, FnvHasher>>,
    pub fragments: RefCell<FragmentSets>,
}

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.

variant_matches

Enum variant matched within a pattern on some match arm, like SomeStruct{ f: Variant1(x, y) } => ...

assignee_ids

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

fragments

Path-fragments from moves in to or out of parts of structured data.

Methods

impl MoveData<'tcx>

fn new() -> MoveData<'tcx>

fn path_loan_path(&self, index: MovePathIndex) -> Rc<LoanPath<'tcx>>

fn move_path(&self, tcx: &ctxt<'tcx>, lp: Rc<LoanPath<'tcx>>) -> 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<'tcx>, lp: Rc<LoanPath<'tcx>>, id: u32, 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<'tcx>, lp: Rc<LoanPath<'tcx>>, assign_id: u32, span: Span, assignee_id: u32, mode: MutateMode)

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

fn add_variant_match(&self, tcx: &ctxt<'tcx>, lp: Rc<LoanPath<'tcx>>, pattern_id: u32, base_lp: Rc<LoanPath<'tcx>>, mode: MatchMode)

Adds a new record for a match of base_lp, downcast to variant lp, that occurs at location pattern_id. (One should be able to recover the span info from the pattern_id and the ast_map, I think.)