From 34d90a46dac95d6f09cd8851b71b43350eecda4d Mon Sep 17 00:00:00 2001 From: Wesley Wiser Date: Fri, 14 Oct 2022 18:44:30 -0400 Subject: Fix line numbers for MIR inlined code `should_collapse_debuginfo` detects if the specified span is part of a macro expansion however it does this by checking if the span is anything other than a normal (non-expanded) kind, then the span sequence is walked backwards to the root span. This doesn't work when the MIR inliner inlines code as it creates spans with expansion information set to `ExprKind::Inlined` and results in the line number being attributed to the inline callsite rather than the normal line number of the inlined code. --- src/test/codegen/mir-inlined-line-numbers.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/test/codegen/mir-inlined-line-numbers.rs b/src/test/codegen/mir-inlined-line-numbers.rs index 53efe0f5be5..19d83f0eee7 100644 --- a/src/test/codegen/mir-inlined-line-numbers.rs +++ b/src/test/codegen/mir-inlined-line-numbers.rs @@ -20,6 +20,6 @@ pub fn example() { // CHECK-LABEL: @example // CHECK: tail call void @bar(), !dbg [[DBG_ID:![0-9]+]] -// CHECK: [[DBG_ID]] = !DILocation(line: 18, +// CHECK: [[DBG_ID]] = !DILocation(line: 7, // CHECK-SAME: inlinedAt: [[INLINE_ID:![0-9]+]]) // CHECK: [[INLINE_ID]] = !DILocation(line: 18, -- cgit 1.4.1-3-g733a5