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

Rollup of 6 pull requests #68659

Merged
merged 18 commits into from
Jan 30, 2020
Merged

Rollup of 6 pull requests #68659

merged 18 commits into from
Jan 30, 2020

Conversation

Dylan-DPC-zz
Copy link

Successful merges:

Failed merges:

r? @ghost

crgl and 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
Author

@bors r+ p=6 rollup=never

@bors
Copy link
Contributor

bors commented Jan 30, 2020

📌 Commit 9f497f9 has been approved by Dylan-DPC

@bors bors 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-zz Dylan-DPC-zz added the rollup A PR which is a rollup label Jan 30, 2020
@bors
Copy link
Contributor

bors commented Jan 30, 2020

⌛ 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
Copy link
Contributor

bors commented Jan 30, 2020

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jan 30, 2020
@bors bors merged commit 9f497f9 into rust-lang:master Jan 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup 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