Skip to content

Conversation

@cgzones
Copy link
Contributor

@cgzones cgzones commented Nov 22, 2025

The struct has only a size of 24 bytes and is trivially copy-able.

Permit SizeHint operations in const contexts and warn on unused
results from constructors or getters without side-effects.

The struct has only a size of 24 bytes and is trivially copy-able.
Permit `SizeHint` operations in const contexts and warn on unused
results from constructors or getters without side-effects.
@seanmonstar
Copy link
Member

Thanks for this! I think making some of these functions const could be nice.

As for the #[must_use], these additions don't quite match up with normal Rust usage. You'll notice many things, even in libstd, return an inner value with no side-effects, and are not marked #[must_use]. It's usually only placed on specific types where forgetting to use the value is almost always wrong.

It looks like you might be interested in the allow-by-default unused-results lint, which you can enable for your projects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants