-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Allow using opt-level="s"/"z" in profile overrides #3007
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
authors = [] | ||
|
||
[profile.dev] | ||
opt-level = {level} |
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.
You're missing quotes around {level}
(at least s
and z
require quotes)
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.
Oh, that simple... Works now, thanks!
Thanks for the PR! As this is a nightly-only feature for now I think the test will need a gate at the top (similar to the plugin tests) to just run on nightly. Other than that though looks good to me! |
@alexcrichton Done |
Looks like tests are failing? |
I think these |
Tests passed now. |
Good question @matklad! I've opened up rust-lang/rust#35784 as a tracking issue for this unstable feature in general, and that seems appropriate to revisit when we move to stabilize the optimization levels. Other than that, looks great to me, thanks @whitequark! @bors: r+ |
📌 Commit bc858b0 has been approved by |
Allow using opt-level="s"/"z" in profile overrides Initially, I've considered making a dedicated `OptLevel` enum, but this appeared to bring no practical benefit, only boilerplate, so I've used a String instead, which is also in line with the `u32` that was there before, not even checked for being in range `0...3`.
☀️ Test successful - cargo-cross-linux, cargo-linux-32, cargo-linux-64, cargo-mac-32, cargo-mac-64, cargo-win-gnu-32, cargo-win-gnu-64, cargo-win-msvc-32, cargo-win-msvc-64 |
Well, it's become a little inconsistent. The "s"/"z" suggestion is only printed after putting e.g. "3" in the Cargo.toml, while the most obvious 's' or 'z' on their own fail to parse with no hint. And BTW, |
Initially, I've considered making a dedicated
OptLevel
enum, but this appeared to bring no practical benefit, only boilerplate, so I've used a String instead, which is also in line with theu32
that was there before, not even checked for being in range0...3
.