Skip to content

Diagnostic derives: allow specifying multiple alternative suggestions - #103209

Merged
bors merged 1 commit into
rust-lang:masterfrom
Xiretza:multiple-suggestions
Oct 26, 2022
Merged

Diagnostic derives: allow specifying multiple alternative suggestions#103209
bors merged 1 commit into
rust-lang:masterfrom
Xiretza:multiple-suggestions

Conversation

@Xiretza

Copy link
Copy Markdown
Contributor

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.

@rustbotrustbot 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
Copy Markdown
Contributor

r? @estebank

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

@rustbot

Copy link
Copy Markdown
Collaborator

rustc_macros::diagnostics was changed

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

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 18, 2022
@Xiretza
Xiretzaforce-pushed the multiple-suggestions branch from a27b77f to 6140004CompareOctober 18, 2022 18:41
@Xiretza

Copy link
Copy Markdown
ContributorAuthor

r? @davidtwco

@davidtwcodavidtwco mentioned this pull request Oct 19, 2022
84 tasks
@davidtwco

Copy link
Copy Markdown
Member

@bors r+

@bors

bors commented Oct 19, 2022

Copy link
Copy Markdown
Collaborator

📌 Commit d96b68f has been approved by davidtwco

It is now in the queue for this repository.

@borsbors 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.
@Dylan-DPCDylan-DPC mentioned this pull request Oct 19, 2022
@Dylan-DPCDylan-DPC mentioned this pull request Oct 21, 2022
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.

@borsbors 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
Xiretzaforce-pushed the multiple-suggestions branch from d96b68f to 2ca67f2CompareOctober 21, 2022 19:41
@Xiretza

Copy link
Copy Markdown
ContributorAuthor

@rustbot ready

@rustbotrustbot 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
Copy Markdown
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
Xiretzaforce-pushed the multiple-suggestions branch from 2ca67f2 to 8bc43f9CompareOctober 23, 2022 16:59
@davidtwco

Copy link
Copy Markdown
Member

@bors r+

@bors

bors commented Oct 25, 2022

Copy link
Copy Markdown
Collaborator

📌 Commit 8bc43f9 has been approved by davidtwco

It is now in the queue for this repository.

@borsbors 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.
@Dylan-DPCDylan-DPC mentioned this pull request Oct 25, 2022
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:masterOct 26, 2022
@rustbotrustbot 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
emilyalbini added a commit to ferrocene/sphinx-shared-resources that referenced this pull request Mar 22, 2023
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-translationArea: Translation infrastructure, and migrating existing diagnostics to SessionDiagnosticS-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant 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

@Xiretza@rust-highfive@rustbot@davidtwco@bors@Noratrieb@estebank