rust/compiler/rustc_mir_dataflow/src
Stuart Cook d3475140ee
Rollup merge of #128666 - pitaj:intrinsic-overflow_checks, r=BoxyUwU
Add `overflow_checks` intrinsic

This adds an intrinsic which allows code in a pre-built library to inherit the overflow checks option from a crate depending on it. This enables code in the standard library to explicitly change behavior based on whether `overflow_checks` are enabled, regardless of the setting used when standard library was compiled.

This is very similar to the `ub_checks` intrinsic, and refactors the two to use a common mechanism.

The primary use case for this is to allow the new `RangeFrom` iterator to yield the maximum element before overflowing, as requested [here](https://github.com/rust-lang/rust/issues/125687#issuecomment-2151118208). This PR includes a working `IterRangeFrom` implementation based on this new intrinsic that exhibits the desired behavior.

[Prior discussion on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/Ability.20to.20select.20code.20based.20on.20.60overflow_checks.60.3F)
2025-11-09 13:22:23 +11:00
..
framework Put Analysis back into Results. 2025-10-28 10:26:50 +11:00
impls Make Analysis immutable in many more places. 2025-10-28 08:23:27 +11:00
move_paths add overflow_checks intrinsic 2025-11-08 10:57:35 -07:00
debuginfo.rs mir-opt: Eliminate dead statements even if they are used by debuginfos 2025-10-02 14:58:59 +08:00
drop_flag_effects.rs use let chains in hir, lint, mir 2025-07-28 06:10:14 +05:00
errors.rs Migrate all diagnostics 2022-10-23 10:09:44 +02:00
lib.rs Put Analysis back into Results. 2025-10-28 10:26:50 +11:00
points.rs Reimplement DestinationPropagation according to live ranges. 2025-09-07 16:24:46 +00:00
rustc_peek.rs Eliminate unnecessary dependency from rustc_mir_dataflow to rustc_hir 2025-08-20 15:04:00 -07:00
un_derefer.rs Greatly simplify lifetime captures in edition 2024 2025-02-22 22:24:52 +00:00
value_analysis.rs erase_regions to erase_and_anonymize_regions 2025-09-09 14:49:16 +02:00