Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

macros: use typed identifiers in diag and subdiag derive #98428

Merged
merged 3 commits into from
Jun 26, 2022

Conversation

davidtwco
Copy link
Member

Using typed identifiers instead of strings with the Fluent identifiers in the diagnostic and subdiagnostic derives - this enables the diagnostic derive to benefit from the compile-time validation that comes with typed identifiers, namely that use of a non-existent Fluent identifier will not compile.

r? @oli-obk

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jun 23, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 23, 2022
@davidtwco davidtwco force-pushed the translation-derive-typed-identifiers branch from 7512081 to 5a726aa Compare June 23, 2022 15:33
@oli-obk
Copy link
Contributor

oli-obk commented Jun 23, 2022

@bors r+

@bors
Copy link
Contributor

bors commented Jun 23, 2022

📌 Commit 5a726aa5f3b035d404baa2aeabeb8a9447bf1387 has been approved by oli-obk

@bors
Copy link
Contributor

bors commented Jun 23, 2022

🌲 The tree is currently closed for pull requests below priority 1000. This pull request will be tested once the tree is reopened.

@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 Jun 23, 2022
Using typed identifiers instead of strings with the Fluent identifier
enables the diagnostic derive to benefit from the compile-time
validation that comes with typed identifiers - use of a non-existent
Fluent identifier will not compile.

Signed-off-by: David Wood <david.wood@huawei.com>
As in the diagnostic derive, using typed identifiers in the
subdiagnostic derive improves the diagnostics of using the subdiagnostic
derive as Fluent messages will be confirmed to exist at compile-time.

Signed-off-by: David Wood <david.wood@huawei.com>
Now that typed identifiers are used in both derives, constructors for
the `DiagnosticMessage` and `SubdiagnosticMessage` types are not
required.

Signed-off-by: David Wood <david.wood@huawei.com>
@davidtwco davidtwco force-pushed the translation-derive-typed-identifiers branch from 5a726aa to dc90d1d Compare June 24, 2022 08:08
@davidtwco
Copy link
Member Author

Rebased after #98353 as it added two new uses of the macro that this PR changes.

@davidtwco
Copy link
Member Author

@bors r=oli-obk

@bors
Copy link
Contributor

bors commented Jun 24, 2022

📌 Commit dc90d1d has been approved by oli-obk

Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Jun 26, 2022
…identifiers, r=oli-obk

macros: use typed identifiers in diag and subdiag derive

Using typed identifiers instead of strings with the Fluent identifiers in the diagnostic and subdiagnostic derives - this enables the diagnostic derive to benefit from the compile-time validation that comes with typed identifiers, namely that use of a non-existent Fluent identifier will not compile.

r? `@oli-obk`
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Jun 26, 2022
…identifiers, r=oli-obk

macros: use typed identifiers in diag and subdiag derive

Using typed identifiers instead of strings with the Fluent identifiers in the diagnostic and subdiagnostic derives - this enables the diagnostic derive to benefit from the compile-time validation that comes with typed identifiers, namely that use of a non-existent Fluent identifier will not compile.

r? ``@oli-obk``
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jun 26, 2022
…identifiers, r=oli-obk

macros: use typed identifiers in diag and subdiag derive

Using typed identifiers instead of strings with the Fluent identifiers in the diagnostic and subdiagnostic derives - this enables the diagnostic derive to benefit from the compile-time validation that comes with typed identifiers, namely that use of a non-existent Fluent identifier will not compile.

r? ```@oli-obk```
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jun 26, 2022
…identifiers, r=oli-obk

macros: use typed identifiers in diag and subdiag derive

Using typed identifiers instead of strings with the Fluent identifiers in the diagnostic and subdiagnostic derives - this enables the diagnostic derive to benefit from the compile-time validation that comes with typed identifiers, namely that use of a non-existent Fluent identifier will not compile.

r? ````@oli-obk````
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 26, 2022
…askrgr

Rollup of 11 pull requests

Successful merges:

 - rust-lang#97140 (std: use an event-flag-based thread parker on SOLID)
 - rust-lang#97295 ([rustc_parse] Forbid `let`s in certain places)
 - rust-lang#97743 (make const_err show up in future breakage reports)
 - rust-lang#97908 (Stabilize NonZero* checked operations constness.)
 - rust-lang#98297 (Transform help popup into a pocket menu)
 - rust-lang#98428 (macros: use typed identifiers in diag and subdiag derive)
 - rust-lang#98528 (Respect --color when building rustbuild itself)
 - rust-lang#98535 (Add regression test for generic const in rustdoc)
 - rust-lang#98538 (Add a ui test for issue rust-lang#91883)
 - rust-lang#98540 (Add regression test for rust-lang#87558)
 - rust-lang#98541 (Update `std::alloc::System` doc example code style)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 0b3b4ef into rust-lang:master Jun 26, 2022
@rustbot rustbot added this to the 1.64.0 milestone Jun 26, 2022
@davidtwco davidtwco deleted the translation-derive-typed-identifiers branch June 27, 2022 07:30
@compiler-errors compiler-errors added the A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic label Aug 11, 2022
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 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.

None yet

6 participants