Skip to content

Commit 643ae95

Browse files
authored
Rollup merge of rust-lang#64974 - ecstatic-morse:generic-graphviz-zebra, r=petrochenkov
Fix zebra-striping in generic dataflow visualization A small formatting improvement to rust-lang#64828. Prior to this, the background color of the first row of the table for each basic block changed seemingly at random. You can see this in [basic block rust-lang#5](rust-lang#64828 (comment)) under "New table". Now it is always light. This also updates the example table to match the current output.
2 parents 2f29548 + ffc52a7 commit 643ae95

File tree

1 file changed

+20
-19
lines changed

1 file changed

+20
-19
lines changed

src/librustc_mir/dataflow/generic/graphviz.rs

+20-19
Original file line numberDiff line numberDiff line change
@@ -165,25 +165,25 @@ where
165165
block: BasicBlock,
166166
) -> io::Result<()> {
167167
// Sample output:
168-
// +-+--------------------------------------------------+
169-
// A | bb4 |
170-
// +-+----------------------------------+---------------+
171-
// B | MIR | STATE |
172-
// +-+----------------------------------+---------------+
173-
// C | | (on entry) | {_0,_2,_3} |
174-
// +-+----------------------------------+---------------+
175-
// D |0| 0: StorageLive(_7) | |
176-
// +-+----------------------------------+---------------+
177-
// |1| 1: StorageLive(_8) | |
178-
// +-+----------------------------------+---------------+
179-
// |2| 2: _8 = &mut _1 | +_8 |
180-
// +-+----------------------------------+---------------+
181-
// E |T| _7 = const Foo::twiddle(move _8) | -_8 |
182-
// +-+----------------------------------+---------------+
183-
// F | | (on unwind) | {_0,_2,_3,_7} |
184-
// +-+----------------------------------+---------------+
185-
// | | (on successful return) | +_7 |
186-
// +-+----------------------------------+---------------+
168+
// +-+-----------------------------------------------+
169+
// A | bb4 |
170+
// +-+----------------------------------+------------+
171+
// B | MIR | STATE |
172+
// +-+----------------------------------+------------+
173+
// C | | (on entry) | {_0,_2,_3} |
174+
// +-+----------------------------------+------------+
175+
// D |0| StorageLive(_7) | |
176+
// +-+----------------------------------+------------+
177+
// |1| StorageLive(_8) | |
178+
// +-+----------------------------------+------------+
179+
// |2| _8 = &mut _1 | +_8 |
180+
// +-+----------------------------------+------------+
181+
// E |T| _4 = const Foo::twiddle(move _2) | -_2 |
182+
// +-+----------------------------------+------------+
183+
// F | | (on unwind) | {_0,_3,_8} |
184+
// +-+----------------------------------+------------+
185+
// | | (on successful return) | +_4 |
186+
// +-+----------------------------------+------------+
187187

188188
write!(
189189
w,
@@ -211,6 +211,7 @@ where
211211
)?;
212212

213213
// C: Entry state
214+
self.bg = Background::Light;
214215
self.results.seek_to_block_start(block);
215216
self.write_row_with_curr_state(w, "", "(on entry)")?;
216217
self.prev_state.overwrite(self.results.get());

0 commit comments

Comments
 (0)