From cfe5c3ca6cb0f0b9ffa3f08c42ed12e39905fdb5 Mon Sep 17 00:00:00 2001 From: Maybe Waffle Date: Wed, 19 Apr 2023 18:18:16 +0000 Subject: [PATCH] Add `#[track_caller]` to `struct_span_err_with_code` (drive-by cleanup) We use caller information to track where a diagnostic was created, so all "helper" diagnostic functions should use `#[track_caller]` --- compiler/rustc_borrowck/src/borrowck_errors.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/rustc_borrowck/src/borrowck_errors.rs b/compiler/rustc_borrowck/src/borrowck_errors.rs index 2bbb9618dbf..acca1a1477f 100644 --- a/compiler/rustc_borrowck/src/borrowck_errors.rs +++ b/compiler/rustc_borrowck/src/borrowck_errors.rs @@ -469,6 +469,7 @@ impl<'cx, 'tcx> crate::MirBorrowckCtxt<'cx, 'tcx> { } #[rustc_lint_diagnostics] + #[track_caller] pub(crate) fn struct_span_err_with_code>( &self, sp: S,