@@ -42,7 +42,7 @@ fn sized_constraint_for_ty<'tcx>(
42
42
let adt_tys = adt. sized_constraint ( tcx) ;
43
43
debug ! ( "sized_constraint_for_ty({:?}) intermediate = {:?}" , ty, adt_tys) ;
44
44
adt_tys
45
- . iter_instantiated_copied ( tcx, args)
45
+ . iter_instantiated ( tcx, args)
46
46
. flat_map ( |ty| sized_constraint_for_ty ( tcx, adtdef, ty) )
47
47
. collect ( )
48
48
}
@@ -92,10 +92,13 @@ fn defaultness(tcx: TyCtxt<'_>, def_id: LocalDefId) -> hir::Defaultness {
92
92
/// - a tuple of type parameters or projections, if there are multiple
93
93
/// such.
94
94
/// - an Error, if a type is infinitely sized
95
- fn adt_sized_constraint ( tcx : TyCtxt < ' _ > , def_id : DefId ) -> & [ Ty < ' _ > ] {
95
+ fn adt_sized_constraint < ' tcx > (
96
+ tcx : TyCtxt < ' tcx > ,
97
+ def_id : DefId ,
98
+ ) -> ty:: EarlyBinder < & ' tcx ty:: List < Ty < ' tcx > > > {
96
99
if let Some ( def_id) = def_id. as_local ( ) {
97
100
if matches ! ( tcx. representability( def_id) , ty:: Representability :: Infinite ) {
98
- return tcx. mk_type_list ( & [ Ty :: new_misc_error ( tcx) ] ) ;
101
+ return ty :: EarlyBinder :: bind ( tcx. mk_type_list ( & [ Ty :: new_misc_error ( tcx) ] ) ) ;
99
102
}
100
103
}
101
104
let def = tcx. adt_def ( def_id) ;
@@ -107,7 +110,7 @@ fn adt_sized_constraint(tcx: TyCtxt<'_>, def_id: DefId) -> &[Ty<'_>] {
107
110
108
111
debug ! ( "adt_sized_constraint: {:?} => {:?}" , def, result) ;
109
112
110
- result
113
+ ty :: EarlyBinder :: bind ( result)
111
114
}
112
115
113
116
/// See `ParamEnv` struct definition for details.
0 commit comments