@@ -458,8 +458,6 @@ pub struct TyParam {
458
458
pub did : ast:: DefId ,
459
459
pub bounds : Vec < TyParamBound > ,
460
460
pub default : Option < Type > ,
461
- /// An optional default bound on the parameter which is unbound, like `Sized?`
462
- pub default_unbound : Option < Type >
463
461
}
464
462
465
463
impl Clean < TyParam > for ast:: TyParam {
@@ -469,7 +467,6 @@ impl Clean<TyParam> for ast::TyParam {
469
467
did : ast:: DefId { krate : ast:: LOCAL_CRATE , node : self . id } ,
470
468
bounds : self . bounds . clean ( cx) ,
471
469
default : self . default . clean ( cx) ,
472
- default_unbound : self . unbound . clean ( cx)
473
470
}
474
471
}
475
472
}
@@ -478,28 +475,27 @@ impl<'tcx> Clean<TyParam> for ty::TypeParameterDef<'tcx> {
478
475
fn clean ( & self , cx : & DocContext ) -> TyParam {
479
476
cx. external_typarams . borrow_mut ( ) . as_mut ( ) . unwrap ( )
480
477
. insert ( self . def_id , self . name . clean ( cx) ) ;
481
- let ( bounds, default_unbound ) = self . bounds . clean ( cx) ;
478
+ let bounds = self . bounds . clean ( cx) ;
482
479
TyParam {
483
480
name : self . name . clean ( cx) ,
484
481
did : self . def_id ,
485
482
bounds : bounds,
486
483
default : self . default . clean ( cx) ,
487
- default_unbound : default_unbound
488
484
}
489
485
}
490
486
}
491
487
492
488
#[ deriving( Clone , RustcEncodable , RustcDecodable , PartialEq ) ]
493
489
pub enum TyParamBound {
494
490
RegionBound ( Lifetime ) ,
495
- TraitBound ( PolyTrait )
491
+ TraitBound ( PolyTrait , ast :: TraitBoundModifier )
496
492
}
497
493
498
494
impl Clean < TyParamBound > for ast:: TyParamBound {
499
495
fn clean ( & self , cx : & DocContext ) -> TyParamBound {
500
496
match * self {
501
497
ast:: RegionTyParamBound ( lt) => RegionBound ( lt. clean ( cx) ) ,
502
- ast:: TraitTyParamBound ( ref t) => TraitBound ( t. clean ( cx) ) ,
498
+ ast:: TraitTyParamBound ( ref t, modifier ) => TraitBound ( t. clean ( cx) , modifier ) ,
503
499
}
504
500
}
505
501
}
@@ -600,7 +596,7 @@ impl Clean<TyParamBound> for ty::BuiltinBound {
600
596
did : did,
601
597
} ,
602
598
lifetimes : vec ! [ ]
603
- } )
599
+ } , ast :: TraitBoundModifier :: None )
604
600
}
605
601
}
606
602
@@ -648,37 +644,20 @@ impl<'tcx> Clean<TyParamBound> for ty::TraitRef<'tcx> {
648
644
TraitBound ( PolyTrait {
649
645
trait_ : ResolvedPath { path : path, typarams : None , did : self . def_id , } ,
650
646
lifetimes : late_bounds
651
- } )
647
+ } , ast :: TraitBoundModifier :: None )
652
648
}
653
649
}
654
650
655
- // Returns (bounds, default_unbound)
656
- impl < ' tcx > Clean < ( Vec < TyParamBound > , Option < Type > ) > for ty:: ParamBounds < ' tcx > {
657
- fn clean ( & self , cx : & DocContext ) -> ( Vec < TyParamBound > , Option < Type > ) {
651
+ impl < ' tcx > Clean < Vec < TyParamBound > > for ty:: ParamBounds < ' tcx > {
652
+ fn clean ( & self , cx : & DocContext ) -> Vec < TyParamBound > {
658
653
let mut v = Vec :: new ( ) ;
659
- let mut has_sized_bound = false ;
660
- for b in self . builtin_bounds . iter ( ) {
661
- if b != ty:: BoundSized {
662
- v. push ( b. clean ( cx) ) ;
663
- } else {
664
- has_sized_bound = true ;
665
- }
666
- }
667
654
for t in self . trait_bounds . iter ( ) {
668
655
v. push ( t. clean ( cx) ) ;
669
656
}
670
657
for r in self . region_bounds . iter ( ) . filter_map ( |r| r. clean ( cx) ) {
671
658
v. push ( RegionBound ( r) ) ;
672
659
}
673
- if has_sized_bound {
674
- ( v, None )
675
- } else {
676
- let ty = match ty:: BoundSized . clean ( cx) {
677
- TraitBound ( polyt) => polyt. trait_ ,
678
- _ => unreachable ! ( )
679
- } ;
680
- ( v, Some ( ty) )
681
- }
660
+ v
682
661
}
683
662
}
684
663
@@ -689,7 +668,7 @@ impl<'tcx> Clean<Option<Vec<TyParamBound>>> for subst::Substs<'tcx> {
689
668
v. extend ( self . types . iter ( ) . map ( |t| TraitBound ( PolyTrait {
690
669
trait_ : t. clean ( cx) ,
691
670
lifetimes : vec ! [ ]
692
- } ) ) ) ;
671
+ } , ast :: TraitBoundModifier :: None ) ) ) ;
693
672
if v. len ( ) > 0 { Some ( v) } else { None }
694
673
}
695
674
}
@@ -1047,8 +1026,6 @@ pub struct Trait {
1047
1026
pub items : Vec < TraitMethod > ,
1048
1027
pub generics : Generics ,
1049
1028
pub bounds : Vec < TyParamBound > ,
1050
- /// An optional default bound not required for `Self`, like `Sized?`
1051
- pub default_unbound : Option < Type >
1052
1029
}
1053
1030
1054
1031
impl Clean < Item > for doctree:: Trait {
@@ -1065,7 +1042,6 @@ impl Clean<Item> for doctree::Trait {
1065
1042
items : self . items . clean ( cx) ,
1066
1043
generics : self . generics . clean ( cx) ,
1067
1044
bounds : self . bounds . clean ( cx) ,
1068
- default_unbound : self . default_unbound . clean ( cx)
1069
1045
} ) ,
1070
1046
}
1071
1047
}
@@ -2412,7 +2388,6 @@ impl Clean<Item> for ty::AssociatedType {
2412
2388
} ,
2413
2389
bounds : vec ! [ ] ,
2414
2390
default : None ,
2415
- default_unbound : None
2416
2391
} ) ,
2417
2392
visibility : None ,
2418
2393
def_id : self . def_id ,
0 commit comments