mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-28 20:16:58 +03:00
3d087e6044
New MIR Pass: SsaRangePropagation As an alternative to https://github.com/rust-lang/rust/pull/150192. Introduces a new pass that propagates the known ranges of SSA locals. We can know the ranges of SSA locals at some locations for the following code: ```rust fn foo(a: u32) { let b = a < 9; if b { let c = b; // c is true since b is whitin the range [1, 2) let d = a < 8; // d is true since b whitin the range [0, 9) } } ``` This PR only implements a trivial range: we know one value on switch, assert, and assume.