-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Don't skip argument parsing when running rustc
with no arguments
#135716
Conversation
Setting up the argument parser to parse no arguments is a tiny bit of wasted work, but avoids an otherwise-unnecessary special case. In particular, this lets us avoid having to deal with multiple different APIs to determine whether the compiler is nightly or not.
r? @fee1-dead rustbot has assigned @fee1-dead. Use |
My main motivation for actually making this change is to reduce the number of calls to |
Makes sense. r? lqd @bors r+ rollup |
…llaumeGomez Rollup of 5 pull requests Successful merges: - rust-lang#134858 (Provide structured suggestion for `#![feature(..)]` in more cases) - rust-lang#135679 (create an issue template for bootstrap) - rust-lang#135685 (Remove unused `item-row` CSS class) - rust-lang#135716 (Don't skip argument parsing when running `rustc` with no arguments) - rust-lang#135723 (Fix dev guide docs for error-pattern) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#135716 - Zalathar:usage-no-args, r=lqd Don't skip argument parsing when running `rustc` with no arguments Setting up the argument parser to parse no arguments is a tiny bit of wasted work, but avoids an otherwise-unnecessary special case, in a scenario (printing a help message and quitting) where perf at this scale really doesn't matter anyway. In particular, this lets us avoid having to deal with multiple different APIs to determine whether the compiler is nightly or not. --- This special-case handling for rustc with no arguments is very very old (long predating 1.0), and used to be much simpler, without any need to set up boolean values to handle various conditional cases. So I don't think it was ever explicitly decided that having this special case was worth the extra complexity; it just started out simple and accumulated complexity over time.
Setting up the argument parser to parse no arguments is a tiny bit of wasted work, but avoids an otherwise-unnecessary special case, in a scenario (printing a help message and quitting) where perf at this scale really doesn't matter anyway.
In particular, this lets us avoid having to deal with multiple different APIs to determine whether the compiler is nightly or not.
This special-case handling for rustc with no arguments is very very old (long predating 1.0), and used to be much simpler, without any need to set up boolean values to handle various conditional cases. So I don't think it was ever explicitly decided that having this special case was worth the extra complexity; it just started out simple and accumulated complexity over time.