@@ -79,14 +79,14 @@ fn opaque_type_bounds<'tcx>(
7979pub ( super ) fn explicit_item_bounds (
8080 tcx : TyCtxt < ' _ > ,
8181 def_id : LocalDefId ,
82- ) -> & ' _ [ ( ty:: Predicate < ' _ > , Span ) ] {
82+ ) -> ty :: EarlyBinder < & ' _ [ ( ty:: Predicate < ' _ > , Span ) ] > {
8383 match tcx. opt_rpitit_info ( def_id. to_def_id ( ) ) {
8484 // RPITIT's bounds are the same as opaque type bounds, but with
8585 // a projection self type.
8686 Some ( ty:: ImplTraitInTraitData :: Trait { opaque_def_id, .. } ) => {
8787 let item = tcx. hir ( ) . get_by_def_id ( opaque_def_id. expect_local ( ) ) . expect_item ( ) ;
8888 let opaque_ty = item. expect_opaque_ty ( ) ;
89- return opaque_type_bounds (
89+ return ty :: EarlyBinder ( opaque_type_bounds (
9090 tcx,
9191 opaque_def_id. expect_local ( ) ,
9292 opaque_ty. bounds ,
@@ -95,15 +95,15 @@ pub(super) fn explicit_item_bounds(
9595 ty:: InternalSubsts :: identity_for_item ( tcx, def_id) ,
9696 ) ,
9797 item. span ,
98- ) ;
98+ ) ) ;
9999 }
100100 // These should have been fed!
101101 Some ( ty:: ImplTraitInTraitData :: Impl { .. } ) => unreachable ! ( ) ,
102102 None => { }
103103 }
104104
105105 let hir_id = tcx. hir ( ) . local_def_id_to_hir_id ( def_id) ;
106- match tcx. hir ( ) . get ( hir_id) {
106+ let bounds = match tcx. hir ( ) . get ( hir_id) {
107107 hir:: Node :: TraitItem ( hir:: TraitItem {
108108 kind : hir:: TraitItemKind :: Type ( bounds, _) ,
109109 span,
@@ -123,14 +123,15 @@ pub(super) fn explicit_item_bounds(
123123 opaque_type_bounds ( tcx, def_id, bounds, item_ty, * span)
124124 }
125125 _ => bug ! ( "item_bounds called on {:?}" , def_id) ,
126- }
126+ } ;
127+ ty:: EarlyBinder ( bounds)
127128}
128129
129130pub ( super ) fn item_bounds (
130131 tcx : TyCtxt < ' _ > ,
131132 def_id : DefId ,
132133) -> ty:: EarlyBinder < & ' _ ty:: List < ty:: Predicate < ' _ > > > {
133- tcx. bound_explicit_item_bounds ( def_id) . map_bound ( |bounds| {
134+ tcx. explicit_item_bounds ( def_id) . map_bound ( |bounds| {
134135 tcx. mk_predicates_from_iter ( util:: elaborate (
135136 tcx,
136137 bounds. iter ( ) . map ( |& ( bound, _span) | bound) ,
0 commit comments