@@ -23,7 +23,7 @@ use rustc_middle::mir::interpret::{AllocDecodingSession, AllocDecodingState};
23
23
use rustc_middle:: ty:: codec:: TyDecoder ;
24
24
use rustc_middle:: ty:: fast_reject:: SimplifiedType ;
25
25
use 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 } ;
27
27
use rustc_serialize:: opaque:: MemDecoder ;
28
28
use rustc_serialize:: { Decodable , Decoder } ;
29
29
use rustc_session:: cstore:: {
@@ -857,6 +857,20 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
857
857
)
858
858
}
859
859
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
+
860
874
fn get_variant ( self , kind : & DefKind , index : DefIndex , parent_did : DefId ) -> ty:: VariantDef {
861
875
let adt_kind = match kind {
862
876
DefKind :: Variant => ty:: AdtKind :: Enum ,
0 commit comments