Skip to content

Rollup of 6 pull requests - #68659

Merged
bors merged 18 commits into
rust-lang:masterfrom
Dylan-DPC-zz:rollup-zo7zi9f
Jan 30, 2020
Merged

Rollup of 6 pull requests#68659
bors merged 18 commits into
rust-lang:masterfrom
Dylan-DPC-zz:rollup-zo7zi9f

Conversation

@Dylan-DPC-zz

Copy link
Copy Markdown

Successful merges:

Failed merges:

r? @ghost

crgland others added 18 commits December 23, 2019 11:03
Co-Authored-By: Ashley Mannix <ashleymannix@live.com.au>
…itions
Co-Authored-By: Mark Rousskov <mark.simulacrum@gmail.com>
Implement clone_from for BTreeMap and BTreeSet
See rust-lang#28481. This results in up to 90% speedups on simple data types when `self` and `other` are the same size, and is generally comparable or faster. Some concerns:
1. This implementation requires an `Ord` bound on the `Clone` implementation for `BTreeMap` and `BTreeSet`. Since these structs can only be created externally for keys with `Ord` implemented, this should be fine? If not, there's certainly a less safe way to do this.
2. Changing `next_unchecked` on `RangeMut` to return mutable key references allows for replacing the entire overlapping portion of both maps without changing the external interface in any way. However, if `clone_from` fails it can leave the `BTreeMap` in an invalid state, which might be unacceptable.
~This probably needs an FCP since it changes a trait bound, but (as far as I know?) that change cannot break any external code.~
…ark-Simulacrum
BTreeMap: tag and explain unsafe internal functions or assert preconditions
rust-lang#68418 concluded that it's not desirable to tag all internal functions with preconditions as being unsafe. This PR does it to some functions, documents why, and elsewhere enforces the preconditions with asserts.
Use termize instead of term_size
`termize` is a fork of `term_size` which uses `winapi` 0.3 instead of 0.2. This is a step towards removing the `winapi` 0.2 dependency.
r? @Mark-Simulacrum
…eklabnik
Document remaining undocumented `From` implementations for IPs
Some `From` implementations were missing documentation. I added examples, I tried to be as close to existing examples as possible.
Related to rust-lang#51430 (cc @skade)
r? @steveklabnik
…=steveklabnik
Document `From` implementation for NonZero nums
This is more of a nitpick than a real change in documentation. I did this for consistency with other documentation (namely Atomic integers).
Related to rust-lang#51430
r? @steveklabnik
PS: I actually tested the code this time. My CPU died in the process, but I get to open a (hopefully 🤞) working PR
Fix revision annotations in borrowck-feature-nll-overrides-migrate
@Dylan-DPC-zz

Copy link
Copy Markdown
Author

@bors r+ p=6 rollup=never

@bors

bors commented Jan 30, 2020

Copy link
Copy Markdown
Collaborator

📌 Commit 9f497f9 has been approved by Dylan-DPC

@borsbors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jan 30, 2020
@Dylan-DPC-zzDylan-DPC-zz added the rollup A PR which is a rollup label Jan 30, 2020
@bors

bors commented Jan 30, 2020

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 9f497f9 with merge 3024c4e...

bors added a commit that referenced this pull request Jan 30, 2020
Rollup of 6 pull requests
Successful merges:
- #66648 (Implement clone_from for BTreeMap and BTreeSet)
- #68468 (BTreeMap: tag and explain unsafe internal functions or assert preconditions)
- #68626 (Use termize instead of term_size)
- #68640 (Document remaining undocumented `From` implementations for IPs)
- #68651 (Document `From` implementation for NonZero nums)
- #68655 (Fix revision annotations in borrowck-feature-nll-overrides-migrate)
Failed merges:
r? @ghost
@bors

bors commented Jan 30, 2020

Copy link
Copy Markdown
Collaborator

☀️ Test successful - checks-azure
Approved by: Dylan-DPC
Pushing 3024c4e to master...

@borsbors added the merged-by-bors This PR was explicitly merged by bors. label Jan 30, 2020
@bors
bors merged commit 9f497f9 into rust-lang:masterJan 30, 2020
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-borsThis PR was explicitly merged by bors.rollupA PR which is a rollupS-waiting-on-borsStatus: 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

@Dylan-DPC-zz@bors@crgl@Zoxc@ssomers@LeSeulArtichaut@tmiasko@Dylan-DPC