Rollup merge of #97653 - RalfJung:int-to-ptr, r=oli-obk

add cast kind of from_exposed_addr (int-to-ptr casts)

This is basically the dual to https://github.com/rust-lang/rust/pull/97582, for int2ptr casts.

Cc `@tmiasko` https://github.com/rust-lang/rust/issues/97649
This commit is contained in:
Dylan DPC 2022-06-03 11:18:24 +02:00 committed by GitHub
commit baacbfda45

View File

@ -131,7 +131,12 @@ fn check_rvalue<'tcx>(
Rvalue::Cast(CastKind::Misc, operand, _) => {
check_operand(tcx, operand, span, body)
},
Rvalue::Cast(CastKind::Pointer(PointerCast::MutToConstPointer | PointerCast::ArrayToPointer), operand, _) => {
Rvalue::Cast(
CastKind::PointerFromExposedAddress
| CastKind::Pointer(PointerCast::MutToConstPointer | PointerCast::ArrayToPointer),
operand,
_
) => {
check_operand(tcx, operand, span, body)
},
Rvalue::Cast(