Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 2d03399

Browse files
committedApr 27, 2020
Auto merge of #71200 - oli-obk:mir_bless, r=eddyb
Emit basic block info for stmts and terminators in MIR dumps only with -Zverbose r? @eddyb as per #70755 (comment)
2 parents 46ec74e + a2fdc94 commit 2d03399

File tree

141 files changed

+3004
-3067
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+3004
-3067
lines changed
 

‎src/librustc_mir/util/pretty.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -305,9 +305,9 @@ where
305305
let indented_body = format!("{0}{0}{1:?};", INDENT, statement);
306306
writeln!(
307307
w,
308-
"{:A$} // {:?}: {}",
308+
"{:A$} // {}{}",
309309
indented_body,
310-
current_location,
310+
if tcx.sess.verbose() { format!("{:?}: ", current_location) } else { String::new() },
311311
comment(tcx, statement.source_info),
312312
A = ALIGN,
313313
)?;
@@ -326,9 +326,9 @@ where
326326
let indented_terminator = format!("{0}{0}{1:?};", INDENT, data.terminator().kind);
327327
writeln!(
328328
w,
329-
"{:A$} // {:?}: {}",
329+
"{:A$} // {}{}",
330330
indented_terminator,
331-
current_location,
331+
if tcx.sess.verbose() { format!("{:?}: ", current_location) } else { String::new() },
332332
comment(tcx, data.terminator().source_info),
333333
A = ALIGN,
334334
)?;
@@ -455,7 +455,7 @@ fn write_scope_tree(
455455
)?;
456456
}
457457

458-
// Local variable types (including the user's name in a comment).
458+
// Local variable types.
459459
for (local, local_decl) in body.local_decls.iter_enumerated() {
460460
if (1..body.arg_count + 1).contains(&local.index()) {
461461
// Skip over argument locals, they're printed in the signature.

‎src/test/mir-opt/address-of/rustc.address_of_reborrow.SimplifyCfg-initial.after.mir

+178-178
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.