match_like_matches_macro

This commit is contained in:
Johann Hemmann 2024-01-19 15:14:29 +01:00
parent 2ae2512378
commit add40c8660
9 changed files with 29 additions and 43 deletions

View file

@ -1387,10 +1387,10 @@ impl Evaluator<'_> {
| CastKind::PointerExposeAddress
| CastKind::PointerFromExposedAddress => {
let current_ty = self.operand_ty(operand, locals)?;
let is_signed = match current_ty.kind(Interner) {
TyKind::Scalar(chalk_ir::Scalar::Int(_)) => true,
_ => false,
};
let is_signed = matches!(
current_ty.kind(Interner),
TyKind::Scalar(chalk_ir::Scalar::Int(_))
);
let current = pad16(self.eval_operand(operand, locals)?.get(self)?, is_signed);
let dest_size =
self.size_of_sized(target_ty, locals, "destination of int to int cast")?;