Commit dcc71c0
authored
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.1 file changed
+1
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1191 | 1191 | | |
1192 | 1192 | | |
1193 | 1193 | | |
1194 | | - | |
1195 | | - | |
1196 | | - | |
1197 | | - | |
1198 | | - | |
1199 | | - | |
1200 | | - | |
1201 | | - | |
1202 | | - | |
1203 | 1194 | | |
1204 | 1195 | | |
1205 | 1196 | | |
| |||
1245 | 1236 | | |
1246 | 1237 | | |
1247 | 1238 | | |
1248 | | - | |
| 1239 | + | |
1249 | 1240 | | |
1250 | 1241 | | |
1251 | 1242 | | |
| |||
0 commit comments