Skip to content

Commit 5c11681

Browse files
Rollup merge of #144920 - compiler-errors:span-arg, r=lqd
Dont print arg span in MIR dump for tail call r? WaffleLapkin This makes the MIR dump for tail call terminators consistent w/ regular calls.
2 parents 518e367 + 878acaa commit 5c11681

6 files changed

+8
-8
lines changed

compiler/rustc_middle/src/mir/pretty.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -970,11 +970,11 @@ impl<'tcx> TerminatorKind<'tcx> {
970970
Call { func, args, destination, .. } => {
971971
write!(fmt, "{destination:?} = ")?;
972972
write!(fmt, "{func:?}(")?;
973-
for (index, arg) in args.iter().map(|a| &a.node).enumerate() {
973+
for (index, arg) in args.iter().enumerate() {
974974
if index > 0 {
975975
write!(fmt, ", ")?;
976976
}
977-
write!(fmt, "{arg:?}")?;
977+
write!(fmt, "{:?}", arg.node)?;
978978
}
979979
write!(fmt, ")")
980980
}
@@ -984,7 +984,7 @@ impl<'tcx> TerminatorKind<'tcx> {
984984
if index > 0 {
985985
write!(fmt, ", ")?;
986986
}
987-
write!(fmt, "{:?}", arg)?;
987+
write!(fmt, "{:?}", arg.node)?;
988988
}
989989
write!(fmt, ")")
990990
}

tests/mir-opt/building/custom/terminators.tail_call.built.after.mir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ fn tail_call(_1: i32) -> i32 {
66

77
bb0: {
88
_2 = Add(copy _1, const 42_i32);
9-
tailcall ident::<i32>(Spanned { node: copy _2, span: $DIR/terminators.rs:32:28: 32:29 (#0) });
9+
tailcall ident::<i32>(copy _2);
1010
}
1111
}

tests/mir-opt/tail_call_drops.f_with_arg.ElaborateDrops.panic-abort.diff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
}
9494

9595
bb11: {
96-
tailcall g_with_arg(Spanned { node: move _10, span: $DIR/tail_call_drops.rs:36:23: 36:36 (#0) }, Spanned { node: move _11, span: $DIR/tail_call_drops.rs:36:38: 36:51 (#0) });
96+
tailcall g_with_arg(move _10, move _11);
9797
}
9898

9999
bb12 (cleanup): {

tests/mir-opt/tail_call_drops.f_with_arg.ElaborateDrops.panic-unwind.diff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
}
9494

9595
bb11: {
96-
tailcall g_with_arg(Spanned { node: move _10, span: $DIR/tail_call_drops.rs:36:23: 36:36 (#0) }, Spanned { node: move _11, span: $DIR/tail_call_drops.rs:36:38: 36:51 (#0) });
96+
tailcall g_with_arg(move _10, move _11);
9797
}
9898

9999
bb12 (cleanup): {

tests/mir-opt/tail_call_drops.f_with_arg.built.after.panic-abort.mir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ fn f_with_arg(_1: String, _2: String) -> () {
9090
}
9191

9292
bb11: {
93-
tailcall g_with_arg(Spanned { node: move _10, span: $DIR/tail_call_drops.rs:36:23: 36:36 (#0) }, Spanned { node: move _11, span: $DIR/tail_call_drops.rs:36:38: 36:51 (#0) });
93+
tailcall g_with_arg(move _10, move _11);
9494
}
9595

9696
bb12: {

tests/mir-opt/tail_call_drops.f_with_arg.built.after.panic-unwind.mir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ fn f_with_arg(_1: String, _2: String) -> () {
9090
}
9191

9292
bb11: {
93-
tailcall g_with_arg(Spanned { node: move _10, span: $DIR/tail_call_drops.rs:36:23: 36:36 (#0) }, Spanned { node: move _11, span: $DIR/tail_call_drops.rs:36:38: 36:51 (#0) });
93+
tailcall g_with_arg(move _10, move _11);
9494
}
9595

9696
bb12: {

0 commit comments

Comments
 (0)