1
Fork 0

be even more precise about "cast" vs "coercion"

This commit is contained in:
Lukas Markeffsky 2024-09-15 19:35:06 +02:00
parent 1efad22339
commit 25b66d8091

View file

@ -652,7 +652,7 @@ fn codegen_stmt<'tcx>(
lval.write_cvalue(fx, res); lval.write_cvalue(fx, res);
} }
Rvalue::Cast( Rvalue::Cast(
CastKind::PointerCoercion(PointerCoercion::ReifyFnPointer), CastKind::PointerCoercion(PointerCoercion::ReifyFnPointer, _),
ref operand, ref operand,
to_ty, to_ty,
) => { ) => {
@ -677,7 +677,7 @@ fn codegen_stmt<'tcx>(
} }
} }
Rvalue::Cast( Rvalue::Cast(
CastKind::PointerCoercion(PointerCoercion::UnsafeFnPointer), CastKind::PointerCoercion(PointerCoercion::UnsafeFnPointer, _),
ref operand, ref operand,
to_ty, to_ty,
) => { ) => {
@ -688,6 +688,7 @@ fn codegen_stmt<'tcx>(
Rvalue::Cast( Rvalue::Cast(
CastKind::PointerCoercion( CastKind::PointerCoercion(
PointerCoercion::MutToConstPointer | PointerCoercion::ArrayToPointer, PointerCoercion::MutToConstPointer | PointerCoercion::ArrayToPointer,
_,
), ),
.., ..,
) => { ) => {
@ -741,7 +742,7 @@ fn codegen_stmt<'tcx>(
} }
} }
Rvalue::Cast( Rvalue::Cast(
CastKind::PointerCoercion(PointerCoercion::ClosureFnPointer(_)), CastKind::PointerCoercion(PointerCoercion::ClosureFnPointer(_), _),
ref operand, ref operand,
_to_ty, _to_ty,
) => { ) => {
@ -763,7 +764,7 @@ fn codegen_stmt<'tcx>(
} }
} }
Rvalue::Cast( Rvalue::Cast(
CastKind::PointerCoercion(PointerCoercion::Unsize), CastKind::PointerCoercion(PointerCoercion::Unsize, _),
ref operand, ref operand,
_to_ty, _to_ty,
) => { ) => {
@ -771,7 +772,7 @@ fn codegen_stmt<'tcx>(
crate::unsize::coerce_unsized_into(fx, operand, lval); crate::unsize::coerce_unsized_into(fx, operand, lval);
} }
Rvalue::Cast( Rvalue::Cast(
CastKind::PointerCoercion(PointerCoercion::DynStar), CastKind::PointerCoercion(PointerCoercion::DynStar, _),
ref operand, ref operand,
_, _,
) => { ) => {