-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Rollup of 3 pull requests #41277
Conversation
frewsxcv
commented
Apr 13, 2017
- Successful merges: Updating docs for std::sync::Weak #29377 #41240, Fix invalid 128-bit division on 32-bit target (#41228) #41250, Updating docs for std::rc::Rc #41266
- Failed merges:
…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
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. |
@bors r+ p=10 |
📌 Commit 6afb2c4 has been approved by |
☀️ Test successful - status-appveyor, status-travis |