Files
rust/compiler/rustc_middle/src
许杰友 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
..
2024-06-01 10:31:32 -04:00
2024-04-20 15:59:54 +02:00
2024-06-06 07:49:47 -04:00
2024-05-10 15:44:03 -04:00
2024-05-26 20:04:05 -04:00