@@ -23,7 +23,7 @@ use rustc_middle::mir::interpret::{AllocDecodingSession, AllocDecodingState};
2323use rustc_middle:: ty:: codec:: TyDecoder ;
2424use rustc_middle:: ty:: fast_reject:: SimplifiedType ;
2525use rustc_middle:: ty:: GeneratorDiagnosticData ;
26- use rustc_middle:: ty:: { self , ParameterizedOverTcx , Ty , TyCtxt , Visibility } ;
26+ use rustc_middle:: ty:: { self , ParameterizedOverTcx , Predicate , Ty , TyCtxt , Visibility } ;
2727use rustc_serialize:: opaque:: MemDecoder ;
2828use rustc_serialize:: { Decodable , Decoder } ;
2929use rustc_session:: cstore:: {
@@ -857,6 +857,20 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
857857 )
858858 }
859859
860+ fn get_explicit_item_bounds (
861+ self ,
862+ index : DefIndex ,
863+ tcx : TyCtxt < ' tcx > ,
864+ ) -> ty:: EarlyBinder < & ' tcx [ ( Predicate < ' tcx > , Span ) ] > {
865+ let lazy = self . root . tables . explicit_item_bounds . get ( self , index) ;
866+ let output = if lazy. is_default ( ) {
867+ & mut [ ]
868+ } else {
869+ tcx. arena . alloc_from_iter ( lazy. decode ( ( self , tcx) ) )
870+ } ;
871+ ty:: EarlyBinder ( & * output)
872+ }
873+
860874 fn get_variant ( self , kind : & DefKind , index : DefIndex , parent_did : DefId ) -> ty:: VariantDef {
861875 let adt_kind = match kind {
862876 DefKind :: Variant => ty:: AdtKind :: Enum ,
0 commit comments