Skip to content

Diagnostic derives: allow specifying multiple alternative suggestions #103209

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Oct 26, 2022

Conversation

Xiretza
Copy link
Contributor

@Xiretza Xiretza commented Oct 18, 2022

This allows porting span_suggestions() to diagnostic structs.

Doesn't work for multipart_suggestions() because the rank would be reversed - the struct would specify multiple spans, each of which has multiple possible replacements, while multipart_suggestions() creates multiple possible replacements, each with multiple spans.

@rustbot rustbot added A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 18, 2022
@rust-highfive
Copy link
Contributor

r? @estebank

(rust-highfive has picked a reviewer for you, use r? to override)

@rustbot
Copy link
Collaborator

rustbot commented Oct 18, 2022

rustc_macros::diagnostics was changed

cc @davidtwco, @compiler-errors, @JohnTitor, @estebank, @TaKO8Ki

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 18, 2022
@Xiretza Xiretza force-pushed the multiple-suggestions branch from a27b77f to 6140004 Compare October 18, 2022 18:41
@Xiretza
Copy link
Contributor Author

Xiretza commented Oct 18, 2022

r? @davidtwco

@rust-highfive rust-highfive assigned davidtwco and unassigned estebank Oct 18, 2022
@Xiretza Xiretza force-pushed the multiple-suggestions branch from 6140004 to d96b68f Compare October 19, 2022 05:21
@davidtwco davidtwco mentioned this pull request Oct 19, 2022
84 tasks
@davidtwco
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Oct 19, 2022

📌 Commit d96b68f has been approved by davidtwco

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 19, 2022
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Oct 19, 2022
…vidtwco

Diagnostic derives: allow specifying multiple alternative suggestions

This allows porting `span_suggestions()` to diagnostic structs.

Doesn't work for `multipart_suggestions()` because the rank would be reversed - the struct would specify multiple spans, each of which has multiple possible replacements, while `multipart_suggestions()` creates multiple possible replacements, each with multiple spans.
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 21, 2022
Rollup of 6 pull requests

Successful merges:

 - rust-lang#102287 (Elaborate supertrait bounds when triggering `unused_must_use` on `impl Trait`)
 - rust-lang#102922 (Filtering spans when emitting json)
 - rust-lang#103051 (translation: doc comments with derives, subdiagnostic-less enum variants, more derive use)
 - rust-lang#103111 (Account for hygiene in typo suggestions, and use them to point to shadowed names)
 - rust-lang#103260 (Fixup a few tests needing asm support)
 - rust-lang#103321 (rustdoc: improve appearance of source page navigation bar)

Failed merges:

 - rust-lang#103209 (Diagnostic derives: allow specifying multiple alternative suggestions)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors

This comment was marked as resolved.

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 21, 2022
@Xiretza Xiretza force-pushed the multiple-suggestions branch from d96b68f to 2ca67f2 Compare October 21, 2022 19:41
@Xiretza
Copy link
Contributor Author

Xiretza commented Oct 21, 2022

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 21, 2022
@Noratrieb
Copy link
Member

Hi, I've seen you changed some diagnostic structs in your PR. After #103345, the way we refer to fluent messages changed. They are now in a flat namespace with the same identifier as in the fluent file. For example, parser::cool_thing is now parser_cool_thing and parser::suggestion just suggestion.
You should rebase to the latest master and change your fluent message references as described above. Thanks!

This allows porting uses of span_suggestions() to diagnostic structs.

Doesn't work for multipart_suggestions() because the rank would be
reversed - the struct would specify multiple spans, each of which has
multiple possible replacements, while multipart_suggestions() creates
multiple possible replacements, each with multiple spans.
@Xiretza Xiretza force-pushed the multiple-suggestions branch from 2ca67f2 to 8bc43f9 Compare October 23, 2022 16:59
@davidtwco
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Oct 25, 2022

📌 Commit 8bc43f9 has been approved by davidtwco

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 25, 2022
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Oct 25, 2022
…vidtwco

Diagnostic derives: allow specifying multiple alternative suggestions

This allows porting `span_suggestions()` to diagnostic structs.

Doesn't work for `multipart_suggestions()` because the rank would be reversed - the struct would specify multiple spans, each of which has multiple possible replacements, while `multipart_suggestions()` creates multiple possible replacements, each with multiple spans.
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 26, 2022
Rollup of 10 pull requests

Successful merges:

 - rust-lang#102951 (suggest type annotation for local statement initialed by ref expression)
 - rust-lang#103209 (Diagnostic derives: allow specifying multiple alternative suggestions)
 - rust-lang#103287 (Use a faster allocation size check in slice::from_raw_parts)
 - rust-lang#103416 (Name the `impl Trait` in region bound suggestions)
 - rust-lang#103430 (Workaround unstable stmt_expr_attributes for method receiver expressions)
 - rust-lang#103444 (Remove extra type error after missing semicolon error)
 - rust-lang#103520 (rustc_middle: Rearrange resolver outputs structures slightly)
 - rust-lang#103533 (Use &self instead of &mut self for cast methods)
 - rust-lang#103536 (Remove `rustc_driver::set_sigpipe_handler()`)
 - rust-lang#103542 (Pinning tests for some `macro_rules!` errors discussed in the lang meeting)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit f2c2e58 into rust-lang:master Oct 26, 2022
@rustbot rustbot added this to the 1.66.0 milestone Oct 26, 2022
flip1995 pushed a commit to flip1995/rust that referenced this pull request Nov 21, 2022
Rollup of 6 pull requests

Successful merges:

 - rust-lang#102287 (Elaborate supertrait bounds when triggering `unused_must_use` on `impl Trait`)
 - rust-lang#102922 (Filtering spans when emitting json)
 - rust-lang#103051 (translation: doc comments with derives, subdiagnostic-less enum variants, more derive use)
 - rust-lang#103111 (Account for hygiene in typo suggestions, and use them to point to shadowed names)
 - rust-lang#103260 (Fixup a few tests needing asm support)
 - rust-lang#103321 (rustdoc: improve appearance of source page navigation bar)

Failed merges:

 - rust-lang#103209 (Diagnostic derives: allow specifying multiple alternative suggestions)

r? `@ghost`
`@rustbot` modify labels: rollup
pietroalbini added a commit to ferrocene/sphinx-shared-resources that referenced this pull request Mar 22, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants