12
12
//! that clean them.
13
13
14
14
pub use self :: Type :: * ;
15
- pub use self :: TypeKind :: * ;
16
15
pub use self :: VariantKind :: * ;
17
16
pub use self :: Mutability :: * ;
18
17
pub use self :: Import :: * ;
@@ -688,7 +687,7 @@ impl Clean<TyParamBound> for ty::BuiltinBound {
688
687
( tcx. lang_items . sync_trait ( ) . unwrap ( ) ,
689
688
external_path ( cx, "Sync" , None , false , vec ! [ ] , empty) ) ,
690
689
} ;
691
- inline:: record_extern_fqn ( cx, did, TypeTrait ) ;
690
+ inline:: record_extern_fqn ( cx, did, TypeKind :: Trait ) ;
692
691
TraitBound ( PolyTrait {
693
692
trait_ : ResolvedPath {
694
693
path : path,
@@ -707,7 +706,7 @@ impl<'tcx> Clean<TyParamBound> for ty::TraitRef<'tcx> {
707
706
Some ( tcx) => tcx,
708
707
None => return RegionBound ( Lifetime :: statik ( ) )
709
708
} ;
710
- inline:: record_extern_fqn ( cx, self . def_id , TypeTrait ) ;
709
+ inline:: record_extern_fqn ( cx, self . def_id , TypeKind :: Trait ) ;
711
710
let path = external_path ( cx, & tcx. item_name ( self . def_id ) . as_str ( ) ,
712
711
Some ( self . def_id ) , true , vec ! [ ] , self . substs ) ;
713
712
@@ -1480,16 +1479,16 @@ pub enum PrimitiveType {
1480
1479
1481
1480
#[ derive( Clone , RustcEncodable , RustcDecodable , Copy , Debug ) ]
1482
1481
pub enum TypeKind {
1483
- TypeEnum ,
1484
- TypeFunction ,
1485
- TypeModule ,
1486
- TypeConst ,
1487
- TypeStatic ,
1488
- TypeStruct ,
1489
- TypeUnion ,
1490
- TypeTrait ,
1491
- TypeVariant ,
1492
- TypeTypedef ,
1482
+ Enum ,
1483
+ Function ,
1484
+ Module ,
1485
+ Const ,
1486
+ Static ,
1487
+ Struct ,
1488
+ Union ,
1489
+ Trait ,
1490
+ Variant ,
1491
+ Typedef ,
1493
1492
}
1494
1493
1495
1494
pub trait GetDefId {
@@ -1795,9 +1794,9 @@ impl<'tcx> Clean<Type> for ty::Ty<'tcx> {
1795
1794
ty:: TyAdt ( def, substs) => {
1796
1795
let did = def. did ;
1797
1796
let kind = match def. adt_kind ( ) {
1798
- AdtKind :: Struct => TypeStruct ,
1799
- AdtKind :: Union => TypeUnion ,
1800
- AdtKind :: Enum => TypeEnum ,
1797
+ AdtKind :: Struct => TypeKind :: Struct ,
1798
+ AdtKind :: Union => TypeKind :: Union ,
1799
+ AdtKind :: Enum => TypeKind :: Enum ,
1801
1800
} ;
1802
1801
inline:: record_extern_fqn ( cx, did, kind) ;
1803
1802
let path = external_path ( cx, & cx. tcx ( ) . item_name ( did) . as_str ( ) ,
@@ -1811,7 +1810,7 @@ impl<'tcx> Clean<Type> for ty::Ty<'tcx> {
1811
1810
}
1812
1811
ty:: TyTrait ( ref obj) => {
1813
1812
let did = obj. principal . def_id ( ) ;
1814
- inline:: record_extern_fqn ( cx, did, TypeTrait ) ;
1813
+ inline:: record_extern_fqn ( cx, did, TypeKind :: Trait ) ;
1815
1814
1816
1815
let mut typarams = vec ! [ ] ;
1817
1816
obj. region_bound . clean ( cx) . map ( |b| typarams. push ( RegionBound ( b) ) ) ;
@@ -2761,24 +2760,24 @@ fn register_def(cx: &DocContext, def: Def) -> DefId {
2761
2760
let tcx = cx. tcx ( ) ;
2762
2761
2763
2762
let ( did, kind) = match def {
2764
- Def :: Fn ( i) => ( i, TypeFunction ) ,
2765
- Def :: TyAlias ( i) => ( i, TypeTypedef ) ,
2766
- Def :: Enum ( i) => ( i, TypeEnum ) ,
2767
- Def :: Trait ( i) => ( i, TypeTrait ) ,
2768
- Def :: Struct ( i) => ( i, TypeStruct ) ,
2769
- Def :: Union ( i) => ( i, TypeUnion ) ,
2770
- Def :: Mod ( i) => ( i, TypeModule ) ,
2771
- Def :: Static ( i, _) => ( i, TypeStatic ) ,
2772
- Def :: Variant ( i) => ( tcx. parent_def_id ( i) . unwrap ( ) , TypeEnum ) ,
2773
- Def :: SelfTy ( Some ( def_id) , _) => ( def_id, TypeTrait ) ,
2763
+ Def :: Fn ( i) => ( i, TypeKind :: Function ) ,
2764
+ Def :: TyAlias ( i) => ( i, TypeKind :: Typedef ) ,
2765
+ Def :: Enum ( i) => ( i, TypeKind :: Enum ) ,
2766
+ Def :: Trait ( i) => ( i, TypeKind :: Trait ) ,
2767
+ Def :: Struct ( i) => ( i, TypeKind :: Struct ) ,
2768
+ Def :: Union ( i) => ( i, TypeKind :: Union ) ,
2769
+ Def :: Mod ( i) => ( i, TypeKind :: Module ) ,
2770
+ Def :: Static ( i, _) => ( i, TypeKind :: Static ) ,
2771
+ Def :: Variant ( i) => ( tcx. parent_def_id ( i) . unwrap ( ) , TypeKind :: Enum ) ,
2772
+ Def :: SelfTy ( Some ( def_id) , _) => ( def_id, TypeKind :: Trait ) ,
2774
2773
Def :: SelfTy ( _, Some ( impl_def_id) ) => {
2775
2774
return impl_def_id
2776
2775
}
2777
2776
_ => return def. def_id ( )
2778
2777
} ;
2779
2778
if did. is_local ( ) { return did }
2780
2779
inline:: record_extern_fqn ( cx, did, kind) ;
2781
- if let TypeTrait = kind {
2780
+ if let TypeKind :: Trait = kind {
2782
2781
let t = inline:: build_external_trait ( cx, tcx, did) ;
2783
2782
cx. external_traits . borrow_mut ( ) . insert ( did, t) ;
2784
2783
}
@@ -2966,7 +2965,7 @@ fn lang_struct(cx: &DocContext, did: Option<DefId>,
2966
2965
Some ( did) => did,
2967
2966
None => return fallback ( box t. clean ( cx) ) ,
2968
2967
} ;
2969
- inline:: record_extern_fqn ( cx, did, TypeStruct ) ;
2968
+ inline:: record_extern_fqn ( cx, did, TypeKind :: Struct ) ;
2970
2969
ResolvedPath {
2971
2970
typarams : None ,
2972
2971
did : did,
0 commit comments