diff options
| author | Ralf Jung <post@ralfj.de> | 2017-07-20 15:27:26 -0700 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2017-07-30 01:11:59 -0700 |
| commit | a233afa794763846a8d970ecedf763350cc2c067 (patch) | |
| tree | 939b1a285050e3592691e86338f8f40fb9264405 /src | |
| parent | 511b88cdce696d04522aa27a741c4033d54e0bef (diff) | |
| download | rust-a233afa794763846a8d970ecedf763350cc2c067.tar.gz rust-a233afa794763846a8d970ecedf763350cc2c067.zip | |
respect lifetime rendering when rendering Suspend validation op
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc/mir/mod.rs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/librustc/mir/mod.rs b/src/librustc/mir/mod.rs index c7be58c13f8..dcab476ec23 100644 --- a/src/librustc/mir/mod.rs +++ b/src/librustc/mir/mod.rs @@ -836,13 +836,25 @@ pub enum StatementKind<'tcx> { Nop, } -#[derive(Copy, Clone, Debug, RustcEncodable, RustcDecodable, PartialEq, Eq)] +#[derive(Copy, Clone, RustcEncodable, RustcDecodable, PartialEq, Eq)] pub enum ValidationOp { Acquire, Release, Suspend(CodeExtent), } +impl Debug for ValidationOp { + fn fmt(&self, fmt: &mut Formatter) -> fmt::Result { + use self::ValidationOp::*; + match *self { + Acquire => write!(fmt, "Acquire"), + Release => write!(fmt, "Release"), + // (reuse lifetime rendering policy from ppaux.) + Suspend(ref ce) => write!(fmt, "Suspend({})", ty::ReScope(*ce)), + } + } +} + impl<'tcx> Debug for Statement<'tcx> { fn fmt(&self, fmt: &mut Formatter) -> fmt::Result { use self::StatementKind::*; |
