You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add [hints] table in Cargo.toml, and a hints.mostly-unused hint (#15673)
The `[hints]` table in a `Cargo.toml` manifest provides optional
information that Cargo can use for building the package, and will use
even when using the package as a dependency. All hints can be safely
ignored, and Cargo only warns about unknown hints, but does not error.
This allows packages to use hints without depending on new Cargo.
Add a `mostly-unused` hint, which allows a package to hint that most
users of the package will not use most of its items. This is useful for
improving the build performance of crates with large dependencies.
Crates can override this hint using `hint-mostly-unused = false` in
their profile for a dependency.
---
In the future, this same mechanism could be used for other hints, such
as
`min-opt-level`.
### How to test and review this PR?
This PR is built atop #15643 .
I'd
suggest reviewing that PR separately, then just reviewing the new
commits in
this PR.
The new "hints" testsuite module demonstrates the expected behavior of
hints.
Like #15643 , the nightly-only
tests
will only pass once rust-lang/rust#135656 has
been
merged into Rust.
0 commit comments