mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-27 07:00:55 +00:00
Add CastKind::Transmute
to MIR
Updates `interpret`, `codegen_ssa`, and `codegen_cranelift` to consume the new cast instead of the intrinsic. Includes `CastTransmute` for custom MIR building, to be able to test the extra UB.
This commit is contained in:
parent
6db2d5989f
commit
8bdd54e8c6
1 changed files with 3 additions and 0 deletions
|
@ -176,6 +176,9 @@ fn check_rvalue<'tcx>(
|
|||
// FIXME(dyn-star)
|
||||
unimplemented!()
|
||||
},
|
||||
Rvalue::Cast(CastKind::Transmute, _, _) => {
|
||||
Err((span, "transmute can attempt to turn pointers into integers, so is unstable in const fn".into()))
|
||||
},
|
||||
// binops are fine on integers
|
||||
Rvalue::BinaryOp(_, box (lhs, rhs)) | Rvalue::CheckedBinaryOp(_, box (lhs, rhs)) => {
|
||||
check_operand(tcx, lhs, span, body)?;
|
||||
|
|
Loading…
Reference in a new issue