Skip to content

Commit de803ef

Browse files
authored
ash: Enable mostly-unused hint to speed up compilation (#1004)
Rust recently introduced the `mostly-unused` hint to speed up compilation of large crates where a significant portion of the contents are unlikely to be used concurrently. `ash` is such a crate, which takes quite long to compile relative to the amount and kind of abstraction it provides, simply caused by the vastness of the Vulkan API (and possible remaining inefficiencies in our generated code). This hint helps the compiler defer code generation until it knows it is definitely referenced and used, much like generics and `#[inline]` (the latter is already used consistently across this crate). All in all this new hint reduces compile time of the `ash` crate by about 8%. It however requires the use of a `nightly` compiler and passing of the `-Zprofile-hint-mostly-unused` flag. The newly introduced `[hints]` table is not a syntax or parsing error on older compilers, but does issue a matching `unused manifest key: hints` warning. https://blog.rust-lang.org/inside-rust/2025/07/15/call-for-testing-hint-mostly-unused/
1 parent e044ecd commit de803ef

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ash/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,6 @@ no-dev-version = true
4444
[package.metadata.docs.rs]
4545
all-features = true
4646
rustdoc-args = ["--cfg", "docsrs"]
47+
48+
[hints]
49+
mostly-unused = true

0 commit comments

Comments
 (0)