@@ -21,7 +21,7 @@ pub use self::DefIdSource::*;
21
21
use middle:: region;
22
22
use middle:: subst;
23
23
use middle:: subst:: VecPerParamSpace ;
24
- use middle:: ty:: { mod, Ty } ;
24
+ use middle:: ty:: { mod, AsPredicate , Ty } ;
25
25
26
26
use std:: rc:: Rc ;
27
27
use std:: str;
@@ -414,7 +414,7 @@ fn parse_ty<'a, 'tcx>(st: &mut PState<'a, 'tcx>, conv: conv_did) -> Ty<'tcx> {
414
414
}
415
415
'x' => {
416
416
assert_eq ! ( next( st) , '[' ) ;
417
- let trait_ref = parse_trait_ref ( st, |x, y| conv ( x, y) ) ;
417
+ let trait_ref = ty :: Binder ( parse_trait_ref ( st, |x, y| conv ( x, y) ) ) ;
418
418
let bounds = parse_existential_bounds ( st, |x, y| conv ( x, y) ) ;
419
419
assert_eq ! ( next( st) , ']' ) ;
420
420
return ty:: mk_trait ( st. tcx , trait_ref, bounds) ;
@@ -603,7 +603,7 @@ fn parse_bare_fn_ty<'a, 'tcx>(st: &mut PState<'a, 'tcx>,
603
603
}
604
604
}
605
605
606
- fn parse_sig < ' a , ' tcx > ( st : & mut PState < ' a , ' tcx > , conv : conv_did ) -> ty:: FnSig < ' tcx > {
606
+ fn parse_sig < ' a , ' tcx > ( st : & mut PState < ' a , ' tcx > , conv : conv_did ) -> ty:: PolyFnSig < ' tcx > {
607
607
assert_eq ! ( next( st) , '[' ) ;
608
608
let mut inputs = Vec :: new ( ) ;
609
609
while peek ( st) != ']' {
@@ -622,9 +622,9 @@ fn parse_sig<'a, 'tcx>(st: &mut PState<'a, 'tcx>, conv: conv_did) -> ty::FnSig<'
622
622
}
623
623
_ => ty:: FnConverging ( parse_ty ( st, |x, y| conv ( x, y) ) )
624
624
} ;
625
- ty:: FnSig { inputs : inputs,
626
- output : output,
627
- variadic : variadic}
625
+ ty:: Binder ( ty :: FnSig { inputs : inputs,
626
+ output : output,
627
+ variadic : variadic} )
628
628
}
629
629
630
630
// Rust metadata parsing
@@ -669,13 +669,13 @@ pub fn parse_predicate<'a,'tcx>(st: &mut PState<'a, 'tcx>,
669
669
-> ty:: Predicate < ' tcx >
670
670
{
671
671
match next ( st) {
672
- 't' => ty :: Predicate :: Trait ( Rc :: new ( parse_trait_ref ( st, conv) ) ) ,
673
- 'e' => ty:: Predicate :: Equate ( parse_ty ( st, |x, y| conv ( x, y) ) ,
674
- parse_ty ( st, |x, y| conv ( x, y) ) ) ,
675
- 'r' => ty:: Predicate :: RegionOutlives ( parse_region ( st, |x, y| conv ( x, y) ) ,
676
- parse_region ( st, |x, y| conv ( x, y) ) ) ,
677
- 'o' => ty:: Predicate :: TypeOutlives ( parse_ty ( st, |x, y| conv ( x, y) ) ,
678
- parse_region ( st, |x, y| conv ( x, y) ) ) ,
672
+ 't' => Rc :: new ( ty :: Binder ( parse_trait_ref ( st, conv) ) ) . as_predicate ( ) ,
673
+ 'e' => ty:: Binder ( ty :: EquatePredicate ( parse_ty ( st, |x, y| conv ( x, y) ) ,
674
+ parse_ty ( st, |x, y| conv ( x, y) ) ) ) . as_predicate ( ) ,
675
+ 'r' => ty:: Binder ( ty :: OutlivesPredicate ( parse_region ( st, |x, y| conv ( x, y) ) ,
676
+ parse_region ( st, |x, y| conv ( x, y) ) ) ) . as_predicate ( ) ,
677
+ 'o' => ty:: Binder ( ty :: OutlivesPredicate ( parse_ty ( st, |x, y| conv ( x, y) ) ,
678
+ parse_region ( st, |x, y| conv ( x, y) ) ) ) . as_predicate ( ) ,
679
679
c => panic ! ( "Encountered invalid character in metadata: {}" , c)
680
680
}
681
681
}
@@ -759,10 +759,12 @@ fn parse_bounds<'a, 'tcx>(st: &mut PState<'a, 'tcx>, conv: conv_did)
759
759
loop {
760
760
match next ( st) {
761
761
'R' => {
762
- param_bounds. region_bounds . push ( parse_region ( st, |x, y| conv ( x, y) ) ) ;
762
+ param_bounds. region_bounds . push (
763
+ parse_region ( st, |x, y| conv ( x, y) ) ) ;
763
764
}
764
765
'I' => {
765
- param_bounds. trait_bounds . push ( Rc :: new ( parse_trait_ref ( st, |x, y| conv ( x, y) ) ) ) ;
766
+ param_bounds. trait_bounds . push (
767
+ Rc :: new ( ty:: Binder ( parse_trait_ref ( st, |x, y| conv ( x, y) ) ) ) ) ;
766
768
}
767
769
'.' => {
768
770
return param_bounds;
0 commit comments