change usages of type_of to bound_type_of
This commit is contained in:
@@ -26,7 +26,7 @@ pub(super) fn mangle<'tcx>(
|
||||
let key = tcx.def_key(ty_def_id);
|
||||
match key.disambiguated_data.data {
|
||||
DefPathData::TypeNs(_) | DefPathData::ValueNs(_) => {
|
||||
instance_ty = tcx.type_of(ty_def_id);
|
||||
instance_ty = tcx.bound_type_of(ty_def_id).subst_identity();
|
||||
debug!(?instance_ty);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -696,7 +696,7 @@ fn transform_ty<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>, options: TransformTyOptio
|
||||
let variant = adt_def.non_enum_variant();
|
||||
let param_env = tcx.param_env(variant.def_id);
|
||||
let field = variant.fields.iter().find(|field| {
|
||||
let ty = tcx.type_of(field.did);
|
||||
let ty = tcx.bound_type_of(field.did).subst_identity();
|
||||
let is_zst =
|
||||
tcx.layout_of(param_env.and(ty)).map_or(false, |layout| layout.is_zst());
|
||||
!is_zst
|
||||
|
||||
Reference in New Issue
Block a user