Skip to content

Commit c4c017a

Browse files
committedAug 21, 2020
Suppress "const" prefix of FnDef in MIR dump
1 parent e15510c commit c4c017a

File tree

70 files changed

+132
-129
lines changed

Some content is hidden

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

70 files changed

+132
-129
lines changed
 

‎src/librustc_middle/mir/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2452,7 +2452,10 @@ impl<'tcx> Debug for Constant<'tcx> {
24522452

24532453
impl<'tcx> Display for Constant<'tcx> {
24542454
fn fmt(&self, fmt: &mut Formatter<'_>) -> fmt::Result {
2455-
write!(fmt, "const ")?;
2455+
match self.literal.ty.kind {
2456+
ty::FnDef(..) => {}
2457+
_ => write!(fmt, "const ")?,
2458+
}
24562459
pretty_print_const(self.literal, fmt, true)
24572460
}
24582461
}

‎src/test/mir-opt/array_index_is_temporary.main.SimplifyCfg-elaborate-drops.after.mir.32bit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ fn main() -> () {
3636
StorageLive(_5); // scope 3 at $DIR/array-index-is-temporary.rs:16:12: 16:29
3737
StorageLive(_6); // scope 4 at $DIR/array-index-is-temporary.rs:16:25: 16:26
3838
_6 = _3; // scope 4 at $DIR/array-index-is-temporary.rs:16:25: 16:26
39-
_5 = const foo(move _6) -> bb1; // scope 4 at $DIR/array-index-is-temporary.rs:16:21: 16:27
39+
_5 = foo(move _6) -> bb1; // scope 4 at $DIR/array-index-is-temporary.rs:16:21: 16:27
4040
// mir::Constant
4141
// + span: $DIR/array-index-is-temporary.rs:16:21: 16:24
4242
// + literal: Const { ty: unsafe fn(*mut usize) -> u32 {foo}, val: Value(Scalar(<ZST>)) }

0 commit comments

Comments
 (0)