about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/errors.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-05-25 18:07:32 +0000
committerbors <bors@rust-lang.org>2024-05-25 18:07:32 +0000
commit48f00110d0dae38b3046a9ac05d20ea321fd6637 (patch)
tree6417020d2d7bfc7adea7f7632eb00216e544dc44 /compiler/rustc_const_eval/src/errors.rs
parent14562ddf8c4302a52c72c9c71f5be6516fec5537 (diff)
parent18cb2fa851e13879f182b19883541f66719b714f (diff)
downloadrust-48f00110d0dae38b3046a9ac05d20ea321fd6637.tar.gz
rust-48f00110d0dae38b3046a9ac05d20ea321fd6637.zip
Auto merge of #121571 - clarfonthey:unchecked-math-preconditions, r=saethlin
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: https://github.com/rust-lang/rust/issues/85122.
Diffstat (limited to 'compiler/rustc_const_eval/src/errors.rs')
0 files changed, 0 insertions, 0 deletions