-
Notifications
You must be signed in to change notification settings - Fork 14k
Exhaustively specify names and stability of --print values
#148990
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
Conversation
|
rustbot has assigned @WaffleLapkin. Use |
|
Because r-a doesn't support macro-rules derives yet (rust-lang/rust-analyzer#21043), autocomplete fails for any items introduced by the derive. So I've been reluctant to macro-rules derives more widely within the compiler. But in this case there's a relatively simple workaround, which is to alias the trait associated constant to a regular associated constant. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me with nits
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
Rebased and addressed the nit; waiting on PR CI. |
|
@bors r=WaffleLapkin |
Exhaustively specify names and stability of `--print` values While trying to add a new unstable `--print` kind for use by compiletest, I found that the relevant code is quite awkward to work with, for a few reasons: - It's spread across various parts of a multi-thousand-line source file. - All newly-added `PrintKind` values are automatically treated as *stable*, unless they are explicitly marked as unstable in a helper function far away. - Parsing `--print` values relies on a separate table of name/value mappings, but there's no exhaustiveness check for that table. This PR therefore: - Extracts the relevant code into its own `print_request` submodule. - Uses a macro-rules derive to obtain an exhaustive list of values. - Uses exhaustive matches to associate a name and stability status with each `PrintKind` value. --- The first commit moves code to a separate module; the second commit contains actual changes. There should be no change to compiler output.
|
Yielding to enclosing rollup. @bors retry |
Rollup of 5 pull requests Successful merges: - #148990 (Exhaustively specify names and stability of `--print` values) - #149127 (unwrap ret ty of `iter::ArrayChunks::into_remainder` ) - #149134 (std: sys: net: uefi: Implement read_vectored) - #149135 (Constify `residual_into_try_type`) - #149160 (Check for intrinsic to fn ptr casts in unified coercions) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #148990 - Zalathar:print-kind, r=WaffleLapkin Exhaustively specify names and stability of `--print` values While trying to add a new unstable `--print` kind for use by compiletest, I found that the relevant code is quite awkward to work with, for a few reasons: - It's spread across various parts of a multi-thousand-line source file. - All newly-added `PrintKind` values are automatically treated as *stable*, unless they are explicitly marked as unstable in a helper function far away. - Parsing `--print` values relies on a separate table of name/value mappings, but there's no exhaustiveness check for that table. This PR therefore: - Extracts the relevant code into its own `print_request` submodule. - Uses a macro-rules derive to obtain an exhaustive list of values. - Uses exhaustive matches to associate a name and stability status with each `PrintKind` value. --- The first commit moves code to a separate module; the second commit contains actual changes. There should be no change to compiler output.
|
Bors no, this has already merged. @bors r- |
|
@bors r- retry |
While trying to add a new unstable
--printkind for use by compiletest, I found that the relevant code is quite awkward to work with, for a few reasons:PrintKindvalues are automatically treated as stable, unless they are explicitly marked as unstable in a helper function far away.--printvalues relies on a separate table of name/value mappings, but there's no exhaustiveness check for that table.This PR therefore:
print_requestsubmodule.PrintKindvalue.The first commit moves code to a separate module; the second commit contains actual changes.
There should be no change to compiler output.