Skip to content

Dont print arg span in MIR dump for tail call #144920

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions compiler/rustc_middle/src/mir/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -970,11 +970,11 @@ impl<'tcx> TerminatorKind<'tcx> {
Call { func, args, destination, .. } => {
write!(fmt, "{destination:?} = ")?;
write!(fmt, "{func:?}(")?;
for (index, arg) in args.iter().map(|a| &a.node).enumerate() {
for (index, arg) in args.iter().enumerate() {
if index > 0 {
write!(fmt, ", ")?;
}
write!(fmt, "{arg:?}")?;
write!(fmt, "{:?}", arg.node)?;
}
write!(fmt, ")")
}
Expand All @@ -984,7 +984,7 @@ impl<'tcx> TerminatorKind<'tcx> {
if index > 0 {
write!(fmt, ", ")?;
}
write!(fmt, "{:?}", arg)?;
write!(fmt, "{:?}", arg.node)?;
}
write!(fmt, ")")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ fn tail_call(_1: i32) -> i32 {

bb0: {
_2 = Add(copy _1, const 42_i32);
tailcall ident::<i32>(Spanned { node: copy _2, span: $DIR/terminators.rs:32:28: 32:29 (#0) });
tailcall ident::<i32>(copy _2);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
}

bb11: {
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) });
tailcall g_with_arg(move _10, move _11);
}

bb12 (cleanup): {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
}

bb11: {
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) });
tailcall g_with_arg(move _10, move _11);
}

bb12 (cleanup): {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ fn f_with_arg(_1: String, _2: String) -> () {
}

bb11: {
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) });
tailcall g_with_arg(move _10, move _11);
}

bb12: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ fn f_with_arg(_1: String, _2: String) -> () {
}

bb11: {
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) });
tailcall g_with_arg(move _10, move _11);
}

bb12: {
Expand Down
Loading