Skip to content

Edit the docs new_in() and with_capacity_in()#154461

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
lms0806:issue_154452
Apr 4, 2026
Merged

Edit the docs new_in() and with_capacity_in()#154461
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
lms0806:issue_154452

Conversation

@lms0806
Copy link
Copy Markdown
Contributor

@lms0806 lms0806 commented Mar 27, 2026

I have updated the documentation for new_in().

While reviewing the code, I noticed that the documentation for with_capacity_in() was also inaccurate, so I have corrected it.

Close #154452

@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 Mar 27, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Mar 27, 2026

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
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, jhpratt

@bjorn3
Copy link
Copy Markdown
Member

bjorn3 commented Mar 27, 2026

HashSet::with_capacity_in has the same issue. HashSet::new_in doesn't have an example at all.

Copy link
Copy Markdown
Member

@Mark-Simulacrum Mark-Simulacrum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be good to fix other types (e.g., HashSet) at the same time. Ideally you would audit the standard library collection types (Box, Vec, BinaryHeap, HashMap/Set, String, and any others I might be forgetting to fix these in one go).

Please keep commits squashed as well.

View changes since this review

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 27, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Mar 27, 2026

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@lms0806 lms0806 requested a review from Mark-Simulacrum April 1, 2026 15:15
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 1, 2026
@Mark-Simulacrum
Copy link
Copy Markdown
Member

@bors r+ rollup

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 4, 2026

📌 Commit a374727 has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 4, 2026
rust-bors bot pushed a commit that referenced this pull request Apr 4, 2026
…uwer

Rollup of 8 pull requests

Successful merges:

 - #149868 (rustc: Stop passing `--allow-undefined` on wasm targets)
 - #153555 (Clarified docs in std::sync::RwLock + added test to ensure that max reader count is respected)
 - #152851 (Fix SGX delayed host lookup via ToSocketAddr)
 - #154051 (use libm for acosh and asinh)
 - #154581 (More informative `Debug for vec::ExtractIf`)
 - #154461 (Edit the docs new_in() and with_capacity_in())
 - #154526 (Panic/return false on overflow in no_threads read/try_read impl)
 - #154798 (rustdoc-search: match path components on words)
@rust-bors rust-bors bot merged commit a660f77 into rust-lang:main Apr 4, 2026
11 checks passed
@rustbot rustbot added this to the 1.96.0 milestone Apr 4, 2026
rust-timer added a commit that referenced this pull request Apr 4, 2026
Rollup merge of #154461 - lms0806:issue_154452, r=Mark-Simulacrum

Edit the docs new_in() and with_capacity_in()

I have updated the documentation for new_in().

While reviewing the code, I noticed that the documentation for with_capacity_in() was also inaccurate, so I have corrected it.

Close #154452
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Apr 5, 2026
…uwer

Rollup of 8 pull requests

Successful merges:

 - rust-lang/rust#149868 (rustc: Stop passing `--allow-undefined` on wasm targets)
 - rust-lang/rust#153555 (Clarified docs in std::sync::RwLock + added test to ensure that max reader count is respected)
 - rust-lang/rust#152851 (Fix SGX delayed host lookup via ToSocketAddr)
 - rust-lang/rust#154051 (use libm for acosh and asinh)
 - rust-lang/rust#154581 (More informative `Debug for vec::ExtractIf`)
 - rust-lang/rust#154461 (Edit the docs new_in() and with_capacity_in())
 - rust-lang/rust#154526 (Panic/return false on overflow in no_threads read/try_read impl)
 - rust-lang/rust#154798 (rustdoc-search: match path components on words)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

example for std::collections HashMap method new_in() uses new() instead of new_in()

5 participants