@@ -93,7 +93,7 @@ fn check_union(tcx: TyCtxt<'_>, def_id: LocalDefId) {
93
93
94
94
/// Check that the fields of the `union` do not need dropping.
95
95
fn check_union_fields ( tcx : TyCtxt < ' _ > , span : Span , item_def_id : LocalDefId ) -> bool {
96
- let item_type = tcx. bound_type_of ( item_def_id) . subst_identity ( ) ;
96
+ let item_type = tcx. type_of ( item_def_id) . subst_identity ( ) ;
97
97
if let ty:: Adt ( def, substs) = item_type. kind ( ) {
98
98
assert ! ( def. is_union( ) ) ;
99
99
@@ -170,7 +170,7 @@ fn check_static_inhabited(tcx: TyCtxt<'_>, def_id: LocalDefId) {
170
170
// would be enough to check this for `extern` statics, as statics with an initializer will
171
171
// have UB during initialization if they are uninhabited, but there also seems to be no good
172
172
// reason to allow any statics to be uninhabited.
173
- let ty = tcx. bound_type_of ( def_id) . subst_identity ( ) ;
173
+ let ty = tcx. type_of ( def_id) . subst_identity ( ) ;
174
174
let span = tcx. def_span ( def_id) ;
175
175
let layout = match tcx. layout_of ( ParamEnv :: reveal_all ( ) . and ( ty) ) {
176
176
Ok ( l) => l,
@@ -227,7 +227,7 @@ fn check_opaque(tcx: TyCtxt<'_>, id: hir::ItemId) {
227
227
if !tcx. features ( ) . impl_trait_projections {
228
228
check_opaque_for_inheriting_lifetimes ( tcx, item. owner_id . def_id , span) ;
229
229
}
230
- if tcx. bound_type_of ( item. owner_id . def_id ) . subst_identity ( ) . references_error ( ) {
230
+ if tcx. type_of ( item. owner_id . def_id ) . subst_identity ( ) . references_error ( ) {
231
231
return ;
232
232
}
233
233
if check_opaque_for_cycles ( tcx, item. owner_id . def_id , substs, span, & origin) . is_err ( ) {
@@ -425,7 +425,7 @@ fn check_opaque_meets_bounds<'tcx>(
425
425
//
426
426
// FIXME: Consider wrapping the hidden type in an existential `Binder` and instantiating it
427
427
// here rather than using ReErased.
428
- let hidden_ty = tcx. bound_type_of ( def_id. to_def_id ( ) ) . subst ( tcx, substs) ;
428
+ let hidden_ty = tcx. type_of ( def_id. to_def_id ( ) ) . subst ( tcx, substs) ;
429
429
let hidden_ty = tcx. fold_regions ( hidden_ty, |re, _dbi| match re. kind ( ) {
430
430
ty:: ReErased => infcx. next_region_var ( RegionVariableOrigin :: MiscVariable ( span) ) ,
431
431
_ => re,
@@ -492,7 +492,7 @@ fn is_enum_of_nonnullable_ptr<'tcx>(
492
492
493
493
fn check_static_linkage ( tcx : TyCtxt < ' _ > , def_id : LocalDefId ) {
494
494
if tcx. codegen_fn_attrs ( def_id) . import_linkage . is_some ( ) {
495
- if match tcx. bound_type_of ( def_id) . subst_identity ( ) . kind ( ) {
495
+ if match tcx. type_of ( def_id) . subst_identity ( ) . kind ( ) {
496
496
ty:: RawPtr ( _) => false ,
497
497
ty:: Adt ( adt_def, substs) => !is_enum_of_nonnullable_ptr ( tcx, * adt_def, * substs) ,
498
498
_ => true ,
@@ -578,7 +578,7 @@ fn check_item_type(tcx: TyCtxt<'_>, id: hir::ItemId) {
578
578
}
579
579
}
580
580
DefKind :: TyAlias => {
581
- let pty_ty = tcx. bound_type_of ( id. owner_id ) . subst_identity ( ) ;
581
+ let pty_ty = tcx. type_of ( id. owner_id ) . subst_identity ( ) ;
582
582
let generics = tcx. generics_of ( id. owner_id ) ;
583
583
check_type_params_are_used ( tcx, & generics, pty_ty) ;
584
584
}
@@ -854,7 +854,7 @@ fn check_impl_items_against_trait<'tcx>(
854
854
}
855
855
856
856
pub fn check_simd ( tcx : TyCtxt < ' _ > , sp : Span , def_id : LocalDefId ) {
857
- let t = tcx. bound_type_of ( def_id) . subst_identity ( ) ;
857
+ let t = tcx. type_of ( def_id) . subst_identity ( ) ;
858
858
if let ty:: Adt ( def, substs) = t. kind ( )
859
859
&& def. is_struct ( )
860
860
{
@@ -974,7 +974,7 @@ pub(super) fn check_packed(tcx: TyCtxt<'_>, sp: Span, def: ty::AdtDef<'_>) {
974
974
& if first {
975
975
format ! (
976
976
"`{}` contains a field of type `{}`" ,
977
- tcx. bound_type_of ( def. did( ) ) . subst_identity( ) ,
977
+ tcx. type_of ( def. did( ) ) . subst_identity( ) ,
978
978
ident
979
979
)
980
980
} else {
@@ -996,7 +996,7 @@ pub(super) fn check_packed_inner(
996
996
def_id : DefId ,
997
997
stack : & mut Vec < DefId > ,
998
998
) -> Option < Vec < ( DefId , Span ) > > {
999
- if let ty:: Adt ( def, substs) = tcx. bound_type_of ( def_id) . subst_identity ( ) . kind ( ) {
999
+ if let ty:: Adt ( def, substs) = tcx. type_of ( def_id) . subst_identity ( ) . kind ( ) {
1000
1000
if def. is_struct ( ) || def. is_union ( ) {
1001
1001
if def. repr ( ) . align . is_some ( ) {
1002
1002
return Some ( vec ! [ ( def. did( ) , DUMMY_SP ) ] ) ;
0 commit comments