groundwork refactoring of gather_moves

This commit is contained in:
Ariel Ben-Yehuda 2016-06-11 23:47:28 +03:00 committed by Ariel Ben-Yehuda
parent 89500e9341
commit eb19cd6575
8 changed files with 494 additions and 722 deletions

View file

@ -1243,7 +1243,7 @@ impl<'a, 'b> GraphSuccessors<'b> for Mir<'a> {
type Iter = IntoIter<BasicBlock>;
}
#[derive(Copy, Clone, PartialEq, Eq, Debug, Hash, Ord, PartialOrd)]
#[derive(Copy, Clone, PartialEq, Eq, Hash, Ord, PartialOrd)]
pub struct Location {
/// the location is within this block
pub block: BasicBlock,
@ -1253,3 +1253,8 @@ pub struct Location {
pub statement_index: usize,
}
impl fmt::Debug for Location {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
write!(fmt, "{:?}[{}]", self.block, self.statement_index)
}
}

View file

@ -774,9 +774,6 @@ pub enum LvalueContext<'tcx> {
// Being borrowed
Borrow { region: &'tcx Region, kind: BorrowKind },
// Being sliced -- this should be same as being borrowed, probably
Slice { from_start: usize, from_end: usize },
// Used as base for another lvalue, e.g. `x` in `x.y`
Projection,