1
Fork 0

Call destructors when dyn* object goes out of scope

This commit is contained in:
Eric Holk 2022-07-27 14:50:11 -07:00
parent 549c105bb3
commit c5441acf67
8 changed files with 59 additions and 18 deletions

View file

@ -216,10 +216,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
};
let from_ty = CastTy::from_ty(ty);
let cast_ty = CastTy::from_ty(expr.ty);
debug!(
"ExprKind::Cast from_ty={from_ty:?}, cast_ty={:?}/{cast_ty:?}",
expr.ty,
);
debug!("ExprKind::Cast from_ty={from_ty:?}, cast_ty={:?}/{cast_ty:?}", expr.ty,);
let cast_kind = match (from_ty, cast_ty) {
(Some(CastTy::Ptr(_) | CastTy::FnPtr), Some(CastTy::Int(_))) => {
CastKind::PointerExposeAddress