Skip to content

Conversation

@clubby789
Copy link
Contributor

@clubby789 clubby789 commented Jan 7, 2026

Implements #150442

Help messages are printed in the order they are invoked, but only once (e.g. --help -C help --help prints regular help then codegen help).

Lint groups (-Whelp) are always printed last due to necessarily coming later in the compiler pipeline.

Adds help flags to -C and -Z to avoid an error in build_session_options.

cc @bjorn3 #t-compiler/major changes > Allow combining `--help -C help -Z help -… compiler-team#954 @ 💬 - this currently maintains the behaviour of unrecognized options always failing-fast, as this happens within getopts parsing, before we can even check if help options are present.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 7, 2026
@rustbot
Copy link
Collaborator

rustbot commented Jan 7, 2026

r? @lcnr

rustbot has assigned @lcnr.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@jyn514
Copy link
Member

jyn514 commented Jan 7, 2026

could you add some tests for this, please?

@rustbot rustbot added the A-run-make Area: port run-make Makefiles to rmake.rs label Jan 7, 2026
@clubby789
Copy link
Contributor Author

Added tests for the new combined help behavior, as well as testing the current behavior of --help --invalid-flag

@lcnr
Copy link
Contributor

lcnr commented Jan 14, 2026

r? compiler

@rustbot rustbot assigned jieyouxu and unassigned lcnr Jan 14, 2026
Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

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

@jieyouxu
Copy link
Member

@bors r+

@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 18, 2026

📌 Commit e834e60 has been approved by jieyouxu

It is now in the queue for this repository.

@rust-bors rust-bors bot 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 Jan 18, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jan 18, 2026
Allow invoking all help options at once

Implements rust-lang#150442

Help messages are printed in the order they are invoked, but only once (e.g. `--help -C help --help` prints regular help then codegen help).

Lint groups (`-Whelp`) are always printed last due to necessarily coming later in the compiler pipeline.

Adds `help` flags to `-C` and `-Z` to avoid an error in `build_session_options`.

cc @bjorn3 [#t-compiler/major changes > Allow combining &rust-lang#96;--help -C help -Z help -… compiler-team#954 @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/233931-t-compiler.2Fmajor-changes/topic/Allow.20combining.20.60--help.20-C.20help.20-Z.20help.20-.E2.80.A6.20compiler-team.23954/near/564358190) - this currently maintains the behaviour of unrecognized options always failing-fast, as this happens within `getopt`s parsing, before we can even check if help options are present.
rust-bors bot pushed a commit that referenced this pull request Jan 18, 2026
…uwer

Rollup of 7 pull requests

Successful merges:

 - #150767 (Allow invoking all help options at once)
 - #150886 (Added mGCA related tests)
 - #151245 (Explicitly list crate level attrs)
 - #151268 (Fix ICE on inconsistent import resolution with macro-attributed extern crate)
 - #151275 (Normalize type_const items even with feature `generic_const_exprs`)
 - #151288 (Use `find_attr` instead of `attr::contains_name` in `lower_const_item_rhs`)
 - #151321 (Port #![no_main] to the attribute parser.)

r? @ghost
@rust-bors rust-bors bot merged commit 05d494f into rust-lang:main Jan 18, 2026
11 checks passed
@rustbot rustbot added this to the 1.95.0 milestone Jan 18, 2026
rust-timer added a commit that referenced this pull request Jan 18, 2026
Rollup merge of #150767 - all-help, r=jieyouxu

Allow invoking all help options at once

Implements #150442

Help messages are printed in the order they are invoked, but only once (e.g. `--help -C help --help` prints regular help then codegen help).

Lint groups (`-Whelp`) are always printed last due to necessarily coming later in the compiler pipeline.

Adds `help` flags to `-C` and `-Z` to avoid an error in `build_session_options`.

cc @bjorn3 [#t-compiler/major changes > Allow combining `--help -C help -Z help -… compiler-team#954 @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/233931-t-compiler.2Fmajor-changes/topic/Allow.20combining.20.60--help.20-C.20help.20-Z.20help.20-.E2.80.A6.20compiler-team.23954/near/564358190) - this currently maintains the behaviour of unrecognized options always failing-fast, as this happens within `getopt`s parsing, before we can even check if help options are present.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-run-make Area: port run-make Makefiles to rmake.rs 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.

6 participants