feat(hints): support minimum optimization levels - #17368
Open
0xPoe wants to merge 3 commits into
Open
Conversation
Record the current ignored-hint behavior across the RFC precedence, scope, validation, and boundary cases. Signed-off-by: 0xPoe <poe.liu@pm.me>
0xPoe
force-pushed
the
hint-min-opt-level
branch
2 times, most recently
from
August 19, 2026 08:03
77b303d to
cc5827c
Compare
RFC 3924 lets a package request a numeric optimization floor without overriding an application's profile choices. Apply the hint after profile and built-in host defaults but before explicit package and build overrides, while leaving the unordered size levels unchanged. Signed-off-by: 0xPoe <poe.liu@pm.me>
0xPoe
force-pushed
the
hint-min-opt-level
branch
4 times, most recently
from
August 21, 2026 07:08
40dc6df to
b532a3f
Compare
Document the unstable gate, accepted range, profile precedence, non-recursive scope, and the narrow cases where packages should request optimization. Include an explicit debugging override so top-level users retain control. Signed-off-by: 0xPoe <poe.liu@pm.me>
0xPoe
force-pushed
the
hint-min-opt-level
branch
from
August 21, 2026 07:18
b532a3f to
2b19c48
Compare
0xPoe
commented
Aug 21, 2026
Member
Author
There was a problem hiding this comment.
🔢 Self-check (PR reviewed by myself and ready for feedback)
-
Code compiles successfully
-
Unit tests added
-
No AI-generated elegant nonsense in PR.
-
Comments added where necessary
-
PR title and description updated
-
Documentation updated
-
PR size is reasonable
| [package] | ||
| name = "cargo-util-schemas" | ||
| version = "0.14.3" | ||
| version = "0.15.0" |
Member
Author
There was a problem hiding this comment.
Because we added a new field to a public struct without marking it as non_exhaustive, I bumped the major version.
| }, | ||
| "TomlDebugInfo": { | ||
| "type": ["string", "integer", "boolean"], | ||
| "type": [ |
Member
Author
There was a problem hiding this comment.
This one was also generated automatically.
| &self, | ||
| pkg_id: PackageId, | ||
| pkg_hints: Option<&Hints>, | ||
| hint_min_opt_level: bool, |
Member
Author
There was a problem hiding this comment.
Not sure if this is the best way to determine whether users want to enable this hint.
0xPoe
marked this pull request as ready for review
August 21, 2026 07:20
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR try to resolve?
ref #17334
This PR would allow Rust library to provide a simple hint about the minimum opt-level to build them with via the
hint.min-opt-levelsetting in the manifest.How to test and review this PR?
Check the unit tests and review it commit by commit.
r?@ghost