Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mention that BTreeMap::new() doesn't allocate #72876

Merged
merged 1 commit into from
Jun 24, 2020

Conversation

TrolledWoods
Copy link
Contributor

I think it would be nice to mention this, so you don't have to dig through the src to look at the definition of new().

I think it would be nice to mention this, so you don't have to dig through the src to look at the definition of new().
@rust-highfive
Copy link
Collaborator

r? @shepmaster

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 1, 2020
@steveklabnik
Copy link
Member

We make this guarantee for a lot of our other collections, so I imagine this is fine, but just in case:

r? @rust-lang/libs

@@ -490,6 +490,8 @@ struct MergeIter<K, V, I: Iterator<Item = (K, V)>> {
impl<K: Ord, V> BTreeMap<K, V> {
/// Makes a new empty BTreeMap with a reasonable choice for B.
Copy link
Member

Choose a reason for hiding this comment

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

While we're in here, I think the "with a reasonable choice for B" bit should be removed, since that implies that there's some other constructor that lets you choose a B.

Choose a reason for hiding this comment

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

will get this change made in another pr, don't want this one stalling because of it :)

@Dylan-DPC-zz
Copy link

r? @sfackler

@Elinvynia Elinvynia added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 10, 2020
@Dylan-DPC-zz
Copy link

r? @Dylan-DPC

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jun 23, 2020

📌 Commit 0c5c644 has been approved by Dylan-DPC

@bors bors 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 Jun 23, 2020
Manishearth added a commit to Manishearth/rust that referenced this pull request Jun 23, 2020
Mention that BTreeMap::new() doesn't allocate

I think it would be nice to mention this, so you don't have to dig through the src to look at the definition of new().
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 23, 2020
…arth

Rollup of 11 pull requests

Successful merges:

 - rust-lang#72780 (Enforce doc alias check)
 - rust-lang#72876 (Mention that BTreeMap::new() doesn't allocate)
 - rust-lang#73244 (Check for assignments between non-conflicting generator saved locals)
 - rust-lang#73488 (code coverage foundation for hash and num_counters)
 - rust-lang#73523 (Fix -Z unpretty=everybody_loops)
 - rust-lang#73587 (Move remaining `NodeId` APIs from `Definitions` to `Resolver`)
 - rust-lang#73601 (Point at the call span when overflow occurs during monomorphization)
 - rust-lang#73613 (The const propagator cannot trace references.)
 - rust-lang#73614 (fix `intrinsics::needs_drop` docs)
 - rust-lang#73630 (Provide context on E0308 involving fn items)
 - rust-lang#73665 (rustc: Modernize wasm checks for atomics)

Failed merges:

r? @ghost
@bors bors merged commit 317a151 into rust-lang:master Jun 24, 2020
Manishearth added a commit to Manishearth/rust that referenced this pull request Jun 24, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Jun 24, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Nov 24, 2020
…rk-Simulacrum

BTreeMap/BTreeSet: make public doc more consistent

Tweaks rust-lang#72876 and rust-lang#73667 and propagate them to `BTreeSet`.
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants