Add #[track_caller] to lint related diagnostic functions#113832
Add #[track_caller] to lint related diagnostic functions#113832bors merged 1 commit intorust-lang:masterfrom
#[track_caller] to lint related diagnostic functions#113832Conversation
|
we also have some macros that reexport fns from Diagnostic to DiagnosticBuilder (or vice versa? can't remember) those may need annotation too |
| } | ||
|
|
||
| #[track_caller] | ||
| pub fn emit_spanned_lint( |
There was a problem hiding this comment.
Should this and similar have #[rustc_lint_diagnostics] also? it seems like there are a lot of lint-related diagnostic functions without #[rustc_lint_diagnostics]...
There was a problem hiding this comment.
It shouldn't matter, I don't even know if they trigger -Ztreat-err-as-bug which is presumably one of the main usages of tracking caller.
There was a problem hiding this comment.
edit: im dumb
rustc_lint_diagnostics shouldn't matter, ideally you'd add that to all the fns that we should deny outside of translatable diagnostics derives but that should be in a separate pr.
|
@bors r=compiler-errors rollup |
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#113811 (Fix removal span calculation of `unused_qualifications` suggestion) - rust-lang#113812 (docs(release): Remove nightly-only cargo item) - rust-lang#113823 (Fix results search alias display) - rust-lang#113824 (a small `fn needs_drop` refactor) - rust-lang#113828 (Ping spastorino on changes to SMIR) - rust-lang#113832 (Add `#[track_caller]` to lint related diagnostic functions) r? `@ghost` `@rustbot` modify labels: rollup
This fixes locations reported by
-Ztrack-diagnostics.