Uh oh!
There was an error while loading. Please reload this page.
Add a message for if an overflow occurs in core::intrinsics::is_nonoverlapping. - #110388
Conversation
and `unwrap` in `core::intrinsics`.
rustbot
commented
Apr 16, 2023
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @scottmcm (or someone else) soon. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
rustbot
commented
Apr 16, 2023
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
saturating_mul instead of a checked_mulsaturating_mul instead of a checked_mul and unwrap in core::intrinsics.scottmcm
commented
Apr 16, 2023
Since this does something different, can you elaborate on why this is better? Is there a test that should be added? |
nullptrderef29
commented
Apr 16, 2023
I just kind of wanted to get rid of the |
nullptrderef29
commented
Apr 16, 2023
maybe something like this? let size = mem::size_of::<T>().checked_mul(count).expect("is_nonoverlapping: size_of::<T>() * count overflows a usize"); |
the8472
commented
Apr 16, 2023
|
`core::intrinsics::is_nonoverlapping`.
saturating_mul instead of a checked_mul and unwrap in core::intrinsics.core::intrinsics::is_nonoverlapping.nullptrderef29
commented
Apr 16, 2023
I have changed it to be an explicit error message on overflow. |
the8472
commented
Apr 16, 2023
@bors r+ rollup |
bors
commented
Apr 16, 2023
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#110038 (Erase regions when confirming transmutability candidate) - rust-lang#110341 (rustdoc: stop passing a title to `replaceState` second argument) - rust-lang#110388 (Add a message for if an overflow occurs in `core::intrinsics::is_nonoverlapping`.) - rust-lang#110404 (fix clippy::toplevel_ref_arg and ::manual_map) - rust-lang#110421 (Spelling librustdoc) - rust-lang#110423 (Spelling srcdoc) - rust-lang#110433 (Windows: map a few more error codes to ErrorKind) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
No description provided.