-
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 dead code in rustc_session::Options
#84802
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
I expect this should help bootstrap time for rustc_session quite a bit (other crates shouldn't be affected). @bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 2828dec942bdc6c8299dbc74411bfa1270ebbf79 with merge 5ce9808b3b5bfb44d46efe3fe2d5d152fd51f39a... |
This reduces the amount of items in the crate by quite a lot.
This also remove the `allow(dead_code)`.
Err ... I guess there's not a way to cancel an ongoing try run, and I don't know a way to tell rust-timer to queue a commit that isn't the latest. @bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit b19c02c with merge a64224eaa14138ddc834a78d854d070df9154409... |
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.
Overall looks fine to me, presuming perf is happy.
pub const parse_wasi_exec_model: &str = "either `command` or `reactor`"; | ||
pub const parse_split_debuginfo: &str = | ||
"one of supported split-debuginfo modes (`off` or `dsymutil`)"; | ||
&[ $( (stringify!($opt), crate::options::parse::$opt, $crate::options::desc::$parse, $desc) ),* ]; |
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.
nit: one of these uses $crate, the other does not. Doesn't matter in practice as it's crate local (I think) but let's be consistent.
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.
Sure thing - I made this change locally, but I don't want to push since it will cancel the perf run.
diff --git a/compiler/rustc_session/src/options.rs b/compiler/rustc_session/src/options.rs
index 735188768e4..cd28517bfbc 100644
--- a/compiler/rustc_session/src/options.rs
+++ b/compiler/rustc_session/src/options.rs
@@ -286,7 +286,7 @@ fn dep_tracking_hash(&self, _for_crate_hash: bool, error_format: ErrorOutputType
pub type $setter_name = fn(&mut $struct_name, v: Option<&str>) -> bool;
pub const $stat: &[(&str, $setter_name, &str, &str)] =
- &[ $( (stringify!($opt), crate::options::parse::$opt, $crate::options::desc::$parse, $desc) ),* ];
+ &[ $( (stringify!($opt), $crate::options::parse::$opt, $crate::options::desc::$parse, $desc) ),* ];
// Sometimes different options need to build a common structure.
// That structure can kept in one of the options' fields, the others become dummy.
☀️ Try build successful - checks-actions |
Queued a64224eaa14138ddc834a78d854d070df9154409 with parent 6e2a344, future comparison URL. |
Finished benchmarking try commit (a64224eaa14138ddc834a78d854d070df9154409): comparison url. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up. @bors rollup=never |
It looks like the time for rustc_session went ... up? 😕 the compiler should be doing strictly less work, maybe it's just noise? |
Likely noise. Dead code doesn't usually influence performance too much as it's not generally codegen'd, and rustc itself is pretty fast. This still seems like an improvement overall to me, though, at least in terms of readability. @bors r+ |
📌 Commit b19c02c has been approved by |
☀️ Test successful - checks-actions |
Fix nit in rustc_session::options Addresses rust-lang#84802 (comment) - I never actually pushed the commit before that PR got merged. r? `@Mark-Simulacrum`
This reduces the amount of items in the crate by quite a lot.
parse_opt_list
andparse_pathbuf_push
functionsallow(dead_code)
.