What is the meaning of BorrowData::assigned_place?


#1

Hi!

Looking at the BorrowData struct in librustc_mir, I wonder what is the meaning of the assigned_place field. Is it just the place in the left-hand-side of the assignment that created the borrow? Otherwise, do you know if there exists some situation in which the dataflow analysis initializes an assigned_place that is not the place that was in the left-hand-side of the first assignment?

BorrowData struct in Rustc

// temporarily allow some dead fields: `kind` and `region` will be
// needed by borrowck; `borrowed_place` will probably be a MovePathIndex when
// that is extended to include borrowed data paths.
#[allow(dead_code)]
#[derive(Debug)]
pub struct BorrowData<'tcx> {
    pub(crate) location: Location,
    pub(crate) kind: mir::BorrowKind,
    pub(crate) region: Region<'tcx>,
    pub(crate) borrowed_place: mir::Place<'tcx>,
    pub(crate) assigned_place: mir::Place<'tcx>,
}