about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src/coverage/query.rs
diff options
context:
space:
mode:
authorJubilee <workingjubilee@gmail.com>2025-06-13 20:59:17 -0700
committerGitHub <noreply@github.com>2025-06-13 20:59:17 -0700
commit4db9554358d85ddd86d71a7ca5477c65321d9523 (patch)
tree6443f719f5c44c06d2dee1f39a085571938387f9 /compiler/rustc_mir_transform/src/coverage/query.rs
parent69b3c577d16ebe86f205a7734a0d0ac30587f4a7 (diff)
parentb131b6f630843d34a14f250e3b46733253f3465b (diff)
downloadrust-4db9554358d85ddd86d71a7ca5477c65321d9523.tar.gz
rust-4db9554358d85ddd86d71a7ca5477c65321d9523.zip
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`
Diffstat (limited to 'compiler/rustc_mir_transform/src/coverage/query.rs')
0 files changed, 0 insertions, 0 deletions