Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #121571 - clarfonthey:unchecked-math-preconditions, r=s…
…aethlin Add assert_unsafe_precondition to unchecked_{add,sub,neg,mul,shl,shr} methods (Old PR is haunted, opening a new one. See #117494 for previous discussion.) This ensures that these preconditions are actually checked in debug mode, and hopefully should let people know if they messed up. I've also replaced the calls (I could find) in the code that use these intrinsics directly with those that use these methods, so that the asserts actually apply. More discussions on people misusing these methods in the tracking issue: rust-lang/rust#85122.
- Loading branch information