Skip to content

macros: diagnostic derive on enums - #102189

Merged
bors merged 1 commit into
rust-lang:masterfrom
davidtwco:translation-derive-enums
Sep 27, 2022
Merged

bors merged 1 commit into
rust-lang:masterfrom
davidtwco:translation-derive-enums

Conversation

@davidtwco

@davidtwco davidtwco commented Sep 23, 2022 •

Copy link
Copy Markdown
Member

Part of #100717.

Extends #[derive(Diagnostic)] to work on enums too where each variant acts like a distinct diagnostic - being able to represent diagnostics this way can be quite a bit simpler for some parts of the compiler.

r? @compiler-errors
cc @Xiretza

@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 Sep 23, 2022
@rustbot

rustbot commented Sep 23, 2022

Copy link
Copy Markdown
Collaborator

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 Sep 23, 2022

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only added this test for the enums, in addition to the existing case that needed changed and is a failing test - most of the logic is the same so I don't think it is super necessary to test everything again with enums but I can if we want.

Comment thread compiler/rustc_macros/src/diagnostics/utils.rs Outdated
Comment thread compiler/rustc_parse/src/parser/diagnostics.rs Outdated
@davidtwco davidtwco mentioned this pull request Sep 26, 2022
84 tasks
Signed-off-by: David Wood <david.wood@huawei.com>
@davidtwco
davidtwco force-pushed the translation-derive-enums branch from 3f0e59d to f20c882 Compare September 26, 2022 10:59

@compiler-errors compiler-errors left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@compiler-errors

Copy link
Copy Markdown
Contributor

@bors r+

@bors

bors commented Sep 27, 2022

Copy link
Copy Markdown
Collaborator

📌 Commit f20c882 has been approved by compiler-errors

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 Sep 27, 2022
@bors

bors commented Sep 27, 2022

Copy link
Copy Markdown
Collaborator

⌛ Testing commit f20c882 with merge de0b511...

@bors

bors commented Sep 27, 2022

Copy link
Copy Markdown
Collaborator

☀️ Test successful - checks-actions
Approved by: compiler-errors
Pushing de0b511 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 27, 2022
@bors
bors merged commit de0b511 into rust-lang:master Sep 27, 2022
@rustbot rustbot added this to the 1.66.0 milestone Sep 27, 2022
@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (de0b511): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.4% [2.1%, 2.8%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.2% [-2.2%, -2.2%] 1
All ❌✅ (primary) - - 0

Cycles

This benchmark run did not return any relevant results for this metric.

Footnotes

  1. the arithmetic mean of the percent change ↩

  2. number of relevant changes ↩

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic merged-by-bors This PR was explicitly merged by bors. 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.

8 participants