Repository navigation
Tracking Issue for hint-min-opt-level #17334
Copy link
Copy link
Open
Labels
C-tracking-issueCategory: A tracking issue for something unstable.Category: A tracking issue for something unstable.
Description
Summary
RFC: #3924
Implementation:
Documentation:
Allow Rust library to provide a simple hint about the minimum opt-level to build them with via the hint.min-opt-level setting in the manifest.
Unresolved Issues
- Should a profile with
opt-level = "s"oropt-level = "z"override a dependency'smin-opt-level? This RFC says it should, but sometimes users might not want that. We could also give more control over that.
Future Extensions
- There are many other possible optimization hints a library might wish to provide, and we could consider adding further hints for those in the future.
- Have a
max-opt-level, for crates that don't benefit fromopt-level = 3to lower the optimiation level to 2. - The mechanism to override a dependency's opt-level using
profile.dev.packageforces a given opt-level whether the dependency asks for higher or lower. Users of overrides, particularly those for"*", might want a mechanism for setting a minimum without overriding a higher optimization level. - Change the default optimization level for the dev profile to 1, rather than 0. opt-level 1 includes optimizations that can make compilation faster, such as by sending less code to the codegen backend (e.g.
LLVM). - Provide a further mechanism for libraries whose performance depends heavily on their dependencies to optimize those dependencies.
- Provide a mechanism for libraries to optimize code inlined or monomorphized by a user's crate. That would likely require compiler enhancements.
- Surface this in a visible way for users to see that it has been applied to their dependencies. For instance, we could note it in
--timings.
About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-tracking-issueCategory: A tracking issue for something unstable.Category: A tracking issue for something unstable.
Type
Projects
- StatusShow more project fieldsNo status
Activity
0xPoe commentedon Aug 9, 2026
I have discussed this with @joshtriplett, and I will go ahead and implement it. He will help review it.
feat(hints): support minimum optimization levels (rust-lang#17368)