more readable printing of validation operands

This commit is contained in:
Ralf Jung 2017-07-31 15:59:29 -07:00
parent 5e426e1068
commit 09cbe588c3
4 changed files with 15 additions and 15 deletions

View file

@ -877,7 +877,7 @@ pub struct ValidationOperand<'tcx, T> {
impl<'tcx, T: Debug> Debug for ValidationOperand<'tcx, T> {
fn fmt(&self, fmt: &mut Formatter) -> fmt::Result {
write!(fmt, "{:?}@{:?}", self.lval, self.ty)?;
write!(fmt, "{:?}: {:?}", self.lval, self.ty)?;
if let Some(ce) = self.re {
// (reuse lifetime rendering policy from ppaux.)
write!(fmt, "/{}", ty::ReScope(ce))?;

View file

@ -22,7 +22,7 @@ fn main() {
// START rustc.node4.EraseRegions.after.mir
// fn foo(_1: &ReErased mut i32) -> () {
// bb0: {
// Validate(Acquire, [_1@&ReFree(DefId { krate: CrateNum(0), node: DefIndex(3) => validate_1/8cd878b::foo[0] }, BrAnon(0)) mut i32]);
// Validate(Acquire, [_1: &ReFree(DefId { krate: CrateNum(0), node: DefIndex(3) => validate_1/8cd878b::foo[0] }, BrAnon(0)) mut i32]);
// return;
// }
// }
@ -30,18 +30,18 @@ fn main() {
// START rustc.node11.EraseRegions.after.mir
// fn main() -> () {
// bb0: {
// Validate(Suspend(ReScope(Misc(NodeId(20)))), [_1@i32]);
// Validate(Suspend(ReScope(Misc(NodeId(20)))), [_1: i32]);
// _4 = &ReErased mut _1;
// Validate(Acquire, [(*_4)@i32/ReScope(Misc(NodeId(20)))]);
// Validate(Suspend(ReScope(Misc(NodeId(20)))), [(*_4)@i32/ReScope(Misc(NodeId(20)))]);
// Validate(Acquire, [(*_4): i32/ReScope(Misc(NodeId(20)))]);
// Validate(Suspend(ReScope(Misc(NodeId(20)))), [(*_4): i32/ReScope(Misc(NodeId(20)))]);
// _3 = &ReErased mut (*_4);
// Validate(Acquire, [(*_3)@i32/ReScope(Misc(NodeId(20)))]);
// Validate(Release, [_3@&ReScope(Misc(NodeId(20))) mut i32]);
// Validate(Acquire, [(*_3): i32/ReScope(Misc(NodeId(20)))]);
// Validate(Release, [_3: &ReScope(Misc(NodeId(20))) mut i32]);
// _2 = const foo(_3) -> bb1;
// }
//
// bb1: {
// Validate(Acquire, [_2@()]);
// Validate(Acquire, [_2: ()]);
// EndRegion(ReScope(Misc(NodeId(20))));
// return;
// }

View file

@ -19,9 +19,9 @@ fn main() {
// START rustc.node4.EraseRegions.after.mir
// fn main() -> () {
// bb1: {
// Validate(Release, [_2@std::boxed::Box<[i32; 3]>]);
// Validate(Release, [_2: std::boxed::Box<[i32; 3]>]);
// _1 = _2 as std::boxed::Box<[i32]> (Unsize);
// Validate(Acquire, [_1@std::boxed::Box<[i32]>]);
// Validate(Acquire, [_1: std::boxed::Box<[i32]>]);
// }
// }
// END rustc.node4.EraseRegions.after.mir

View file

@ -32,13 +32,13 @@ fn main() {
// fn main() -> () {
// let mut _5: &ReErased i32;
// bb0: {
// Validate(Suspend(ReScope(Misc(NodeId(46)))), [((*_2).0: i32)@i32/ReScope(Remainder(BlockRemainder { block: NodeId(18), first_statement_index: 3 })) (imm)]);
// Validate(Suspend(ReScope(Misc(NodeId(46)))), [((*_2).0: i32): i32/ReScope(Remainder(BlockRemainder { block: NodeId(18), first_statement_index: 3 })) (imm)]);
// _5 = &ReErased ((*_2).0: i32);
// Validate(Acquire, [(*_5)@i32/ReScope(Misc(NodeId(46))) (imm)]);
// Validate(Suspend(ReScope(Misc(NodeId(46)))), [(*_5)@i32/ReScope(Misc(NodeId(46))) (imm)]);
// Validate(Acquire, [(*_5): i32/ReScope(Misc(NodeId(46))) (imm)]);
// Validate(Suspend(ReScope(Misc(NodeId(46)))), [(*_5): i32/ReScope(Misc(NodeId(46))) (imm)]);
// _4 = &ReErased (*_5);
// Validate(Acquire, [(*_4)@i32/ReScope(Misc(NodeId(46))) (imm)]);
// Validate(Release, [_4@&ReScope(Misc(NodeId(46))) i32]);
// Validate(Acquire, [(*_4): i32/ReScope(Misc(NodeId(46))) (imm)]);
// Validate(Release, [_4: &ReScope(Misc(NodeId(46))) i32]);
// _3 = const foo(_4) -> bb1;
// }
// bb1: {