mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-29 11:51:31 +03:00
000ccd651d
Replace Rvalue::NullaryOp by a variant in mir::Operand. Based on https://github.com/rust-lang/rust/pull/148151 This PR fully removes the MIR `Rvalue::NullaryOp`. After rust-lang/rust#148151, it was only useful for runtime checks like `ub_checks`, `contract_checks` and `overflow_checks`. These are "runtime" checks, boolean constants that may only be `true` in codegen. It depends on a rustc flag passed to codegen, so we need to represent those flags cross-crate. This PR replaces those runtime checks by special variants in MIR `ConstValue`. This allows code that expects constants to manipulate those as such, even if we may not always be able to evaluate them to actual scalars.