Skip to content

Commit

Permalink
print normalized ty
Browse files Browse the repository at this point in the history
  • Loading branch information
ouz-a committed Oct 3, 2023
1 parent 4f75af9 commit a8027c8
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions compiler/rustc_const_eval/src/interpret/operand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -670,19 +670,24 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {

trace!("eval_place_to_op: got {:?}", op);
// Sanity-check the type we ended up with.
debug_assert!(
mir_assign_valid_types(
if cfg!(debug_assertions) {
let normalized_place_ty = self.subst_from_current_frame_and_normalize_erasing_regions(
mir_place.ty(&self.frame().body.local_decls, *self.tcx).ty,
)?;
if !mir_assign_valid_types(
*self.tcx,
self.param_env,
self.layout_of(self.subst_from_current_frame_and_normalize_erasing_regions(
mir_place.ty(&self.frame().body.local_decls, *self.tcx).ty
)?)?,
self.layout_of(normalized_place_ty)?,
op.layout,
),
"eval_place of a MIR place with type {:?} produced an interpreter operand with type {}",
mir_place.ty(&self.frame().body.local_decls, *self.tcx).ty,
op.layout.ty,
);
) {
span_bug!(
self.cur_span(),
"eval_place of a MIR place with type {:?} produced an interpreter operand with type {}",
normalized_place_ty,
op.layout.ty,
)
}
}
Ok(op)
}

Expand Down

0 comments on commit a8027c8

Please sign in to comment.