rust/compiler/rustc_const_eval/src
Matthias Krüger 6fb00b1514
Rollup merge of #143477 - folkertdev:use-is-multiple-of, r=joshtriplett
use `is_multiple_of` and `div_ceil`

In tricky logic, these functions are much more informative than the manual implementations. They also catch subtle bugs:

- the manual `is_multiple_of` often does not handle division by zero
- manual `div_ceil` often does not consider overflow

The transformation is free for `is_multiple_of` if the divisor is compile-time known to be non-zero. For `div_ceil` there is a small cost to considering overflow. Here is some assembly https://godbolt.org/z/5zP8KaE1d.
2025-07-06 10:03:23 +02:00
..
check_consts Port #[target_feature] to the new attribute parsing infrastructure 2025-07-03 07:54:19 +02:00
const_eval Stop using Key trait randomly 2025-07-05 18:37:11 +00:00
interpret use is_multiple_of instead of manual modulo 2025-07-05 10:55:35 +02:00
util setup CI and tidy to use typos for spellchecking and fix few typos 2025-07-03 10:51:06 +03:00
errors.rs rename Pointer::from_addr_invalid to match strict provenance API 2025-06-29 00:16:19 +02:00
lib.rs update cfg(bootstrap) 2025-05-12 15:33:37 +02:00