Trim extra whitespace in fn ptr suggestion span#133151
Merged
bors merged 1 commit intorust-lang:masterfrom Jan 28, 2025
Merged
Conversation
Collaborator
|
rustbot has assigned @compiler-errors. Use |
Collaborator
|
☔ The latest upstream changes (presumably #135525) made this pull request unmergeable. Please resolve the merge conflicts. |
Contributor
|
Can you rebase this? Sorry, this looks good but it needs updating. @rustbot author |
Trim extra whitespace when suggesting removal of invalid qualifiers when parsing function pointer type. Fixes: rust-lang#133083 Signed-off-by: Tyrone Wu <wudevelops@gmail.com>
d67caa6 to
5082fd8
Compare
Contributor
Author
|
The branch should be updated now. 🫡 Let me know if there's anything else you'd like me to address! @rustbot label -S-waiting-on-author +S-waiting-on-review |
compiler-errors
approved these changes
Jan 27, 2025
Contributor
|
@bors r+ rollup |
Collaborator
Zalathar
added a commit
to Zalathar/rust
that referenced
this pull request
Jan 28, 2025
…r=compiler-errors Trim extra whitespace in fn ptr suggestion span Trim extra whitespace when suggesting removal of invalid qualifiers when parsing function pointer type. Fixes: rust-lang#133083 --- I made a comment about the format of the diagnostic error message in rust-lang#133083 (comment). I think the `.label` may be a little redundant if the diagnostic only highlights the bad qualifier instead of the entire `TyKind::BareFn` span. If it makes sense, I can include it in this PR.
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jan 28, 2025
Rollup of 9 pull requests Successful merges: - rust-lang#133151 (Trim extra whitespace in fn ptr suggestion span) - rust-lang#133929 (Remove -Zinline-in-all-cgus and clean up tests/codegen-units/) - rust-lang#134290 (Windows x86: Change i128 to return via the vector ABI) - rust-lang#135886 (Document purpose of closure in from_fn.rs more clearly) - rust-lang#136012 (Document powf and powi values that are always 1.0) - rust-lang#136104 (Add mermaid graphs of NLL regions and SCCs to polonius MIR dump) - rust-lang#136117 (Subtree update of `rust-analyzer`) - rust-lang#136143 (Update books) - rust-lang#136153 (Locate asan-odr-win with other sanitizer tests) r? `@ghost` `@rustbot` modify labels: rollup
Zalathar
added a commit
to Zalathar/rust
that referenced
this pull request
Jan 28, 2025
…r=compiler-errors Trim extra whitespace in fn ptr suggestion span Trim extra whitespace when suggesting removal of invalid qualifiers when parsing function pointer type. Fixes: rust-lang#133083 --- I made a comment about the format of the diagnostic error message in rust-lang#133083 (comment). I think the `.label` may be a little redundant if the diagnostic only highlights the bad qualifier instead of the entire `TyKind::BareFn` span. If it makes sense, I can include it in this PR.
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jan 28, 2025
Rollup of 7 pull requests Successful merges: - rust-lang#133151 (Trim extra whitespace in fn ptr suggestion span) - rust-lang#134290 (Windows x86: Change i128 to return via the vector ABI) - rust-lang#135886 (Document purpose of closure in from_fn.rs more clearly) - rust-lang#136012 (Document powf and powi values that are always 1.0) - rust-lang#136104 (Add mermaid graphs of NLL regions and SCCs to polonius MIR dump) - rust-lang#136143 (Update books) - rust-lang#136153 (Locate asan-odr-win with other sanitizer tests) r? `@ghost` `@rustbot` modify labels: rollup
Zalathar
added a commit
to Zalathar/rust
that referenced
this pull request
Jan 28, 2025
…r=compiler-errors Trim extra whitespace in fn ptr suggestion span Trim extra whitespace when suggesting removal of invalid qualifiers when parsing function pointer type. Fixes: rust-lang#133083 --- I made a comment about the format of the diagnostic error message in rust-lang#133083 (comment). I think the `.label` may be a little redundant if the diagnostic only highlights the bad qualifier instead of the entire `TyKind::BareFn` span. If it makes sense, I can include it in this PR.
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jan 28, 2025
Rollup of 7 pull requests Successful merges: - rust-lang#133151 (Trim extra whitespace in fn ptr suggestion span) - rust-lang#133929 (Remove -Zinline-in-all-cgus and clean up tests/codegen-units/) - rust-lang#135886 (Document purpose of closure in from_fn.rs more clearly) - rust-lang#135961 (Fix 2/4 tests skipped by opt-dist) - rust-lang#136104 (Add mermaid graphs of NLL regions and SCCs to polonius MIR dump) - rust-lang#136124 (Arbitrary self types v2: explain test.) - rust-lang#136153 (Locate asan-odr-win with other sanitizer tests) r? `@ghost` `@rustbot` modify labels: rollup
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Jan 28, 2025
…r=compiler-errors Trim extra whitespace in fn ptr suggestion span Trim extra whitespace when suggesting removal of invalid qualifiers when parsing function pointer type. Fixes: rust-lang#133083 --- I made a comment about the format of the diagnostic error message in rust-lang#133083 (comment). I think the `.label` may be a little redundant if the diagnostic only highlights the bad qualifier instead of the entire `TyKind::BareFn` span. If it makes sense, I can include it in this PR.
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jan 28, 2025
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#133151 (Trim extra whitespace in fn ptr suggestion span) - rust-lang#133829 (Implement `AtomicT::update` & `AtomicT::try_update`) - rust-lang#135367 (Enable `unreachable_pub` lint in `alloc`) - rust-lang#135748 (Lower index bounds checking to `PtrMetadata`, this time with the right fake borrow semantics 😸) - rust-lang#135805 (Add missing allocator safety in alloc crate) - rust-lang#135886 (Document purpose of closure in from_fn.rs more clearly) - rust-lang#135961 (Fix 2/4 tests skipped by opt-dist) - rust-lang#136012 (Document powf and powi values that are always 1.0) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jan 28, 2025
Rollup merge of rust-lang#133151 - tyrone-wu:trim-fn-ptr-whitespace, r=compiler-errors Trim extra whitespace in fn ptr suggestion span Trim extra whitespace when suggesting removal of invalid qualifiers when parsing function pointer type. Fixes: rust-lang#133083 --- I made a comment about the format of the diagnostic error message in rust-lang#133083 (comment). I think the `.label` may be a little redundant if the diagnostic only highlights the bad qualifier instead of the entire `TyKind::BareFn` span. If it makes sense, I can include it in this PR.
This was referenced Jun 10, 2025
workingjubilee
added a commit
to workingjubilee/rustc
that referenced
this pull request
Jun 14, 2025
…n, 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 rust-lang#142268, which is an issue created by rust-lang#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`
rust-timer
added a commit
that referenced
this pull request
Jun 14, 2025
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 #142268, which is an issue created by #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`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Trim extra whitespace when suggesting removal of invalid qualifiers when parsing function pointer type.
Fixes: #133083
I made a comment about the format of the diagnostic error message in #133083 (comment). I think the
.labelmay be a little redundant if the diagnostic only highlights the bad qualifier instead of the entireTyKind::BareFnspan. If it makes sense, I can include it in this PR.