From e6a7fdedd720cce583f30cab41f67bf0a353a75a Mon Sep 17 00:00:00 2001 From: jyn Date: Wed, 17 May 2023 23:15:22 -0500 Subject: Give a more useful location for where a span_bug was delayed Before: ``` = note: delayed at 0: ::emit_diagnostic at ./compiler/rustc_errors/src/lib.rs:1335:29 1: ::emit_diagnostic at ./compiler/rustc_errors/src/lib.rs:1124:9 ... ``` After: ``` = note: delayed at compiler/rustc_parse/src/parser/diagnostics.rs:2158:28 0: ::emit_diagnostic at ./compiler/rustc_errors/src/lib.rs:1335:29 1: ::emit_diagnostic at ./compiler/rustc_errors/src/lib.rs:1124:9 ``` This both makes the relevant frame easier to find without having to dig through diagnostic internals, and avoids the weird-looking formatting for the first frame. --- compiler/rustc_parse/src/parser/diagnostics.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'compiler/rustc_parse/src/parser') diff --git a/compiler/rustc_parse/src/parser/diagnostics.rs b/compiler/rustc_parse/src/parser/diagnostics.rs index 3002f23da75..bcef0f7185f 100644 --- a/compiler/rustc_parse/src/parser/diagnostics.rs +++ b/compiler/rustc_parse/src/parser/diagnostics.rs @@ -238,6 +238,7 @@ impl<'a> DerefMut for SnapshotParser<'a> { impl<'a> Parser<'a> { #[rustc_lint_diagnostics] + #[track_caller] pub fn struct_span_err>( &self, sp: S, -- cgit 1.4.1-3-g733a5