Remove rustc_session::config::rustc_short_optgroups#132891
Merged
bors merged 2 commits intorust-lang:masterfrom Nov 11, 2024
Merged
Remove rustc_session::config::rustc_short_optgroups#132891bors merged 2 commits intorust-lang:masterfrom
rustc_session::config::rustc_short_optgroups#132891bors merged 2 commits intorust-lang:masterfrom
Conversation
Collaborator
Zalathar
commented
Nov 11, 2024
Member
|
r? jieyouxu |
jieyouxu
approved these changes
Nov 11, 2024
compiler/rustc_session/src/config.rs
Outdated
Comment on lines
1401
to
1408
| /// Display name for this option. Normally equal to `long_name`, except for | ||
| /// options that don't have a long name. | ||
| pub name: &'static str, |
Member
There was a problem hiding this comment.
Suggestion: display_name? We have short_name and long_name below, so having just name feels a bit confusing.
Member
Author
There was a problem hiding this comment.
So, in the process of looking into this, I remembered that things are actually more complicated.
We do use this as a display name, but it also gets used for other things, such as matching against the option name reported by some getopts errors.
So I'm going to push a better comment, but now I don't like the idea of trying to rename name in this PR.
Comment on lines
+1412
to
+1419
| /// If true, this option should not be printed by `rustc --help`, but | ||
| /// should still be printed by `rustc --help -v`. | ||
| pub is_verbose_help_only: bool, |
Member
There was a problem hiding this comment.
Remark: yes thank you, this is so much clearer.
Member
|
@rustbot author |
e4d6ff5 to
8b4701d
Compare
Member
Author
Member
|
@bors r+ rollup |
Collaborator
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Nov 11, 2024
…iaskrgr Rollup of 4 pull requests Successful merges: - rust-lang#129627 (Ensure that tail expr receive lifetime extension) - rust-lang#130999 (Implement file_lock feature) - rust-lang#132873 (handle separate prefixes in clippy rules) - rust-lang#132891 (Remove `rustc_session::config::rustc_short_optgroups`) r? `@ghost` `@rustbot` modify labels: rollup
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Nov 11, 2024
…iaskrgr Rollup of 4 pull requests Successful merges: - rust-lang#129627 (Ensure that tail expr receive lifetime extension) - rust-lang#130999 (Implement file_lock feature) - rust-lang#132873 (handle separate prefixes in clippy rules) - rust-lang#132891 (Remove `rustc_session::config::rustc_short_optgroups`) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Nov 11, 2024
Rollup merge of rust-lang#132891 - Zalathar:short-opt-groups, r=jieyouxu Remove `rustc_session::config::rustc_short_optgroups` Follow-up to rust-lang#132754 (comment). The name `rustc_short_optgroups` has always been confusing, because it is unrelated to the distinction between short and long options (i.e. `-s` vs `--long`), and instead means something like “the subset of command-line options that are printed by `rustc --help` without `-v`”. So let's merge that function into the main `rustc_optgroups`, and store the relevant bit of information in a boolean field in `RustcOptGroup` instead. --- This PR also modifies `RustcOptGroup` to store its various strings directly, instead of inside a boxed `apply` closure. That turned out to not be necessary for the main change, but is a worthwhile cleanup in its own right.
mati865
pushed a commit
to mati865/rust
that referenced
this pull request
Nov 12, 2024
Remove `rustc_session::config::rustc_short_optgroups` Follow-up to rust-lang#132754 (comment). The name `rustc_short_optgroups` has always been confusing, because it is unrelated to the distinction between short and long options (i.e. `-s` vs `--long`), and instead means something like “the subset of command-line options that are printed by `rustc --help` without `-v`”. So let's merge that function into the main `rustc_optgroups`, and store the relevant bit of information in a boolean field in `RustcOptGroup` instead. --- This PR also modifies `RustcOptGroup` to store its various strings directly, instead of inside a boxed `apply` closure. That turned out to not be necessary for the main change, but is a worthwhile cleanup in its own right.
mati865
pushed a commit
to mati865/rust
that referenced
this pull request
Nov 12, 2024
…iaskrgr Rollup of 4 pull requests Successful merges: - rust-lang#129627 (Ensure that tail expr receive lifetime extension) - rust-lang#130999 (Implement file_lock feature) - rust-lang#132873 (handle separate prefixes in clippy rules) - rust-lang#132891 (Remove `rustc_session::config::rustc_short_optgroups`) r? `@ghost` `@rustbot` modify labels: rollup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #132754 (comment).
The name
rustc_short_optgroupshas always been confusing, because it is unrelated to the distinction between short and long options (i.e.-svs--long), and instead means something like “the subset of command-line options that are printed byrustc --helpwithout-v”.So let's merge that function into the main
rustc_optgroups, and store the relevant bit of information in a boolean field inRustcOptGroupinstead.This PR also modifies
RustcOptGroupto store its various strings directly, instead of inside a boxedapplyclosure. That turned out to not be necessary for the main change, but is a worthwhile cleanup in its own right.