-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Remove rustc_session::config::rustc_short_optgroups
#132891
Conversation
r? jieyouxu |
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.
Very nice cleanup! One minor naming nit then r=me.
compiler/rustc_session/src/config.rs
Outdated
/// Display name for this option. Normally equal to `long_name`, except for | ||
/// options that don't have a long name. | ||
pub name: &'static str, |
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.
Suggestion: display_name
? We have short_name
and long_name
below, so having just name
feels a bit confusing.
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.
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.
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.
Yes, that's fine with me.
/// 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, |
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.
Remark: yes thank you, this is so much clearer.
@rustbot author |
e4d6ff5
to
8b4701d
Compare
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.
Cool
@bors r+ rollup |
…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
…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
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.
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.
…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
Follow-up to #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 byrustc --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 inRustcOptGroup
instead.This PR also modifies
RustcOptGroup
to store its various strings directly, instead of inside a boxedapply
closure. That turned out to not be necessary for the main change, but is a worthwhile cleanup in its own right.