Files
rust/compiler
Jubilee 4db9554358 Rollup merge of #142302 - JonathanBrouwer:invalid-const-token, r=jdonszelmann
Rework how the disallowed qualifier in function type diagnostics are generated

This pull request fixes two independent issues:
1. When qualifiers of a function type ptr are in the wrong order and one of them is async/const (not permitted on function types), the diagnostic suggests removing the incorrect qualifier.  Fixes https://github.com/rust-lang/rust/issues/142268, which is an issue created by https://github.com/rust-lang/rust/pull/133151. This is fixed by moving the check into `parse_fn_front_matter`, where better span information is available to generate the right suggestions.
2. When qualifiers of a function type ptr are in the wrong order and one of them is async/const (not permitted on function types), `cargo fix` crashes because "cannot replace slice of data that was already replaced". This is fixed by not generating a suggestion for the "wrong order" diagnostic if the "disallowed qualifier" diagnostic is triggered.

There is a commit with failing tests so the test diff is clearer
r? `@jdonszelmann`
2025-06-13 20:59:17 -07:00
..
2025-06-12 20:27:10 +02:00
2025-06-06 14:20:48 +00:00
2025-06-12 09:56:47 +02:00
2025-06-12 09:56:47 +02:00
2025-05-30 02:28:35 +10:00
2025-06-12 21:17:17 +10:00
2025-05-12 15:33:37 +02:00
2025-06-03 14:23:56 +02:00