Skip to content

Add #[must_use] attribute to HashMap and HashSet constructors#153204

Open
xtqqczze wants to merge 1 commit intorust-lang:mainfrom
xtqqczze:must-use-map
Open

Add #[must_use] attribute to HashMap and HashSet constructors#153204
xtqqczze wants to merge 1 commit intorust-lang:mainfrom
xtqqczze:must-use-map

Conversation

@xtqqczze
Copy link
Contributor

@xtqqczze xtqqczze commented Feb 28, 2026

  • new_in
  • with_capacity_and_hasher
  • with_capacity_and_hasher_in
  • with_hasher
  • with_hasher_in

See also: #89692

@rustbot
Copy link
Collaborator

rustbot commented Feb 28, 2026

r? @joboet

rustbot has assigned @joboet.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @ChrisDenton, libs
  • @ChrisDenton, libs expanded to 8 candidates
  • Random selection from Mark-Simulacrum, joboet

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Feb 28, 2026
@joboet
Copy link
Member

joboet commented Feb 28, 2026

r? libs-api
but this makes sense to me.

@rustbot rustbot added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Feb 28, 2026
@rustbot rustbot assigned the8472 and unassigned joboet Feb 28, 2026
@xtqqczze
Copy link
Contributor Author

@joboet perhaps if the return type name for these functions was specified as Self this would be helpful for review?

@joboet
Copy link
Member

joboet commented Feb 28, 2026

No, on the contrary; having this PR only contain the #[must_use] one-line additions is rather helpful.

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

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants