rust/compiler/rustc_middle
许杰友 Jieyou Xu (Joe) cfd48bdd7e
Rollup merge of #126265 - RalfJung:interpret-cast-validity, r=oli-obk
interpret: ensure we check bool/char for validity when they are used in a cast

In general, `Scalar::to_bits` is a bit dangerous as it bypasses all type information. We should usually prefer matching on the type and acting according to that. So I also refactored `unary_op` handling of integers to do that. The remaining `to_bits` uses are operations that just fundamentally don't care about the sign (and only work on integers).

invalid_char_cast.rs is the key new test, the others already passed before this PR.

r? `@oli-obk`
2024-06-11 14:16:47 +01:00
..
src Rollup merge of #126265 - RalfJung:interpret-cast-validity, r=oli-obk 2024-06-11 14:16:47 +01:00
Cargo.toml Remove some unused crate dependencies. 2024-06-10 19:55:49 +10:00
messages.ftl
README.md

For more information about how rustc works, see the rustc dev guide.