Skip to content

Consider setting hints.mostly-unused in Cargo.toml #1320

Open
@FalkWoldmann

Description

@FalkWoldmann

Describe the feature

hints.mostly-unused is a new feature in nightly Rust that allows library crates to declare that most of their API might be unused. As discussed in #113, this is definitely the case for many AWS SDKs. This information allows Rust to optimize compilation time.

The Rust blog by @joshtriplett, introducing the feature, even mentions aws-sdk-ec2 as a good example where this feature halved compilation time. [1]

Adding the following configuration snippet:

[hints]
mostly-unused = true

to the Cargo.toml files enables this optimization for SDK crates, provided the user is using a nightly Rust toolchain. For users not on a nightly toolchain, this attribute is a no-op, making it safe to include.

[1] - https://blog.rust-lang.org/inside-rust/2025/07/15/call-for-testing-hint-mostly-unused/

Use Case

Compilation time (#113) is the most up-voted issue.

Proposed Solution

No response

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

A note for the community

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue, please leave a comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestA feature should be added or improved.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions