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 3 pull requests #41277

Merged
merged 6 commits into from
Apr 13, 2017
Merged

Rollup of 3 pull requests #41277

merged 6 commits into from
Apr 13, 2017

Conversation

frewsxcv
Copy link
Member

projektir and others added 6 commits April 12, 2017 00:19
…g#41228.

Added test cases to cover all special-cased branches of udivmodti4.
Updating docs for std::sync::Weak rust-lang#29377

I will duplicate these changes for [`std::rc::Weak`] if they are approved.

[`std::rc::Weak`]: https://doc.rust-lang.org/std/rc/struct.Weak.html

r? @jonathandturner
Fix invalid 128-bit division on 32-bit target (rust-lang#41228)

The bug of rust-lang#41228 is a typo, this line: https://github.com/rust-lang/rust/blob/1dca19ae3fd195fa517e326a39bfee729da7cadb/src/libcompiler_builtins/lib.rs#L183

```rust
            // 1 <= sr <= u64::bits() - 1
            q = n.wrapping_shl(64u32.wrapping_sub(sr));
```

The **64** should be **128**.

(Compare with https://github.com/rust-lang-nursery/compiler-builtins/blob/280d19f1127aa80739f4179152b11a5f7d36d79f/src/int/udiv.rs#L213-L214:

```rust
            // 1 <= sr <= <hty!($ty)>::bits() - 1
            q = n << (<$ty>::bits() - sr);
```

Or compare with the C implementation https://github.com/llvm-mirror/compiler-rt/blob/master/lib/builtins/udivmodti4.c#L113-L116

```c
        /* 1 <= sr <= n_udword_bits - 1 */
        /* q.all = n.all << (n_utword_bits - sr); */
        q.s.low = 0;
        q.s.high = n.s.low << (n_udword_bits - sr);
```
)

Added a bunch of randomly generated division test cases to try to cover every described branch of `udivmodti4`.
Updating docs for std::rc::Rc

The same changes as PR [rust-lang#41240 ](rust-lang#41240), but for [`std::rc::Weak`](https://doc.rust-lang.org/std/rc/struct.Weak.html). At least, as far as I am aware, the Weak pointer is the same for both, and they're basically the same, just one is thread-safe and the other is not.

r? @alexcrichton
@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @sfackler (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@frewsxcv
Copy link
Member Author

@bors r+ p=10

@bors
Copy link
Contributor

bors commented Apr 13, 2017

📌 Commit 6afb2c4 has been approved by frewsxcv

@bors
Copy link
Contributor

bors commented Apr 13, 2017

⌛ Testing commit 6afb2c4 with merge ea37682...

bors added a commit that referenced this pull request Apr 13, 2017
Rollup of 3 pull requests

- Successful merges: #41240, #41250, #41266
- Failed merges:
@bors
Copy link
Contributor

bors commented Apr 13, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: frewsxcv
Pushing ea37682 to master...

@bors bors merged commit 6afb2c4 into rust-lang:master Apr 13, 2017
@Centril Centril added the rollup A PR which is a rollup label Oct 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR which is a rollup
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants