mirror of
https://github.com/allankoechke/rust.git
synced 2026-12-03 09:32:42 +00:00
avoid pointless spans in target modifier errors Fixes https://github.com/rust-lang/rust/issues/161174. Currently the diagnostics for target modifier issues always point at the beginning of the first non-empty line in the file. That makes no sense at all IMO since the error has nothing to do with that line: the error is in the CLI flags. So let's just remove this pointless span. While doing this I realized there are other errors also doing this, e.g. `report_incompatible_partial_mitigations` and `report_incompatible_async_drop_feature`. Cc @arielb1 @azhogin why was this done? @rust-lang/wg-diagnostics do you see any reason to have these diagnostics point at `krate.spans.inner_span.shrink_to_lo()`? IMO that is just never a useful thing to do.