Skip to content

Commit 0d353cd

Browse files
committed
Make TerminatorKind::Call::func Spanned and remove ::fn_span
To get structural symmetry between `TerminatorKind::Call::func` and `TerminatorKind::Call::args`, make `func` `Spanned`, since `args` already is `Spanned`. This way we can remove the separate `fn_span` field. This is a separate commit to make review easy. This commit does not build. The next commit makes no semantic changes, it only makes the code compile again.
1 parent a34faab commit 0d353cd

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

compiler/rustc_middle/src/mir/syntax.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -668,8 +668,10 @@ pub enum TerminatorKind<'tcx> {
668668
///
669669
/// [#71117]: https://github.com/rust-lang/rust/issues/71117
670670
Call {
671-
/// The function that’s being called.
672-
func: Operand<'tcx>,
671+
/// The function that’s being called, including the `Span` of the
672+
/// function, without the dot and receiver
673+
/// e.g. `foo(a, b)` in `x.foo(a, b)`
674+
func: Spanned<Operand<'tcx>>,
673675
/// Arguments the function is called with.
674676
/// These are owned by the callee, which is free to modify them.
675677
/// This allows the memory occupied by "by-value" arguments to be
@@ -685,9 +687,6 @@ pub enum TerminatorKind<'tcx> {
685687
unwind: UnwindAction,
686688
/// Where this call came from in HIR/THIR.
687689
call_source: CallSource,
688-
/// This `Span` is the span of the function, without the dot and receiver
689-
/// e.g. `foo(a, b)` in `x.foo(a, b)`
690-
fn_span: Span,
691690
},
692691

693692
/// Evaluates the operand, which must have type `bool`. If it is not equal to `expected`,

0 commit comments

Comments
 (0)