@@ -657,7 +657,7 @@ impl Clean<VariantKind> for ast::variant_kind {
657657 }
658658}
659659
660- impl Clean < ~str > for syntax:: codemap:: span {
660+ impl Clean < ~str > for syntax:: codemap:: Span {
661661 fn clean ( & self ) -> ~str {
662662 let cm = local_data:: get ( super :: ctxtkey, |x| x. unwrap ( ) . clone ( ) ) . sess . codemap ;
663663 cm. span_to_str ( * self )
@@ -697,7 +697,7 @@ fn path_to_str(p: &ast::Path) -> ~str {
697697 s
698698}
699699
700- impl Clean < ~str > for ast:: ident {
700+ impl Clean < ~str > for ast:: Ident {
701701 fn clean ( & self ) -> ~str {
702702 its ( self ) . to_owned ( )
703703 }
@@ -779,15 +779,13 @@ impl Clean<Item> for doctree::Static {
779779pub enum Mutability {
780780 Mutable ,
781781 Immutable ,
782- Const ,
783782}
784783
785- impl Clean < Mutability > for ast:: mutability {
784+ impl Clean < Mutability > for ast:: Mutability {
786785 fn clean ( & self ) -> Mutability {
787786 match self {
788- & ast:: m_mutbl => Mutable ,
789- & ast:: m_imm => Immutable ,
790- & ast:: m_const => Const
787+ & ast:: MutMutable => Mutable ,
788+ & ast:: MutImmutable => Immutable ,
791789 }
792790 }
793791}
@@ -885,7 +883,7 @@ trait ToSource {
885883 fn to_src ( & self ) -> ~str ;
886884}
887885
888- impl ToSource for syntax:: codemap:: span {
886+ impl ToSource for syntax:: codemap:: Span {
889887 fn to_src ( & self ) -> ~str {
890888 debug ! ( "converting span %s to snippet" , self . clean( ) ) ;
891889 let cm = local_data:: get ( super :: ctxtkey, |x| x. unwrap ( ) . clone ( ) ) . sess . codemap . clone ( ) ;
@@ -912,23 +910,23 @@ fn lit_to_str(lit: &ast::lit) -> ~str {
912910 }
913911}
914912
915- fn name_from_pat ( p: & ast:: pat ) -> ~str {
913+ fn name_from_pat ( p: & ast:: Pat ) -> ~str {
916914 use syntax:: ast:: * ;
917915 match p. node {
918- pat_wild => ~"_",
919- pat_ident ( _, ref p, _) => path_to_str ( p) ,
920- pat_enum ( ref p, _) => path_to_str ( p) ,
921- pat_struct ( * ) => fail ! ( "tried to get argument name from pat_struct, \
922- which is not allowed in function arguments") ,
923- pat_tup ( * ) => ~"( tuple arg NYI ) ",
924- pat_box ( p) => name_from_pat ( p) ,
925- pat_uniq ( p) => name_from_pat ( p) ,
926- pat_region ( p) => name_from_pat ( p) ,
927- pat_lit ( * ) => fail ! ( "tried to get argument name from pat_lit, \
928- which is not allowed in function arguments") ,
929- pat_range ( * ) => fail ! ( "tried to get argument name from pat_range, \
930- which is not allowed in function arguments") ,
931- pat_vec ( * ) => fail ! ( "tried to get argument name from pat_vec, \
916+ PatWild => ~"_",
917+ PatIdent ( _, ref p, _) => path_to_str ( p) ,
918+ PatEnum ( ref p, _) => path_to_str ( p) ,
919+ PatStruct ( * ) => fail ! ( "tried to get argument name from pat_struct, \
920+ which is not allowed in function arguments") ,
921+ PatTup ( * ) => ~"( tuple arg NYI ) ",
922+ PatBox ( p) => name_from_pat ( p) ,
923+ PatUniq ( p) => name_from_pat ( p) ,
924+ PatRegion ( p) => name_from_pat ( p) ,
925+ PatLit ( * ) => fail ! ( "tried to get argument name from pat_lit, \
926+ which is not allowed in function arguments") ,
927+ PatRange ( * ) => fail ! ( "tried to get argument name from pat_range, \
928+ which is not allowed in function arguments") ,
929+ PatVec ( * ) => fail ! ( "tried to get argument name from pat_vec, \
932930 which is not allowed in function arguments")
933931 }
934932}
@@ -945,23 +943,6 @@ fn remove_comment_tags(s: &str) -> ~str {
945943 }
946944}
947945
948- /*fn collapse_docs(attrs: ~[Attribute]) -> ~[Attribute] {
949- let mut docstr = ~"";
950- for at in attrs.iter() {
951- match *at {
952- //XXX how should these be separated?
953- NameValue(~"doc", ref s) => docstr.push_str(fmt!("%s ", clean_comment_body(s.clone()))),
954- _ => ()
955- }
956- }
957- let mut a = attrs.iter().filter(|&a| match a {
958- &NameValue(~"doc", _) => false,
959- _ => true
960- }).map(|x| x.clone()).collect::<~[Attribute]>();
961- a.push(NameValue(~"doc", docstr.trim().to_owned()));
962- a
963- }*/
964-
965946/// Given a Type, resolve it using the def_map
966947fn resolve_type( t : & Type ) -> Type {
967948 use syntax:: ast:: * ;
@@ -984,21 +965,21 @@ fn resolve_type(t: &Type) -> Type {
984965 } ;
985966
986967 let def_id = match * d {
987- def_fn ( i, _) => i,
988- def_self ( i, _) | def_self_ty ( i) => return Self ( i) ,
989- def_ty ( i) => i,
990- def_trait ( i) => {
991- debug ! ( "saw def_trait in def_to_id" ) ;
968+ DefFn ( i, _) => i,
969+ DefSelf ( i, _) | DefSelfTy ( i) => return Self ( i) ,
970+ DefTy ( i) => i,
971+ DefTrait ( i) => {
972+ debug ! ( "saw DefTrait in def_to_id" ) ;
992973 i
993974 } ,
994- def_prim_ty ( p) => match p {
975+ DefPrimTy ( p) => match p {
995976 ty_str => return String ,
996977 ty_bool => return Bool ,
997978 _ => return Primitive ( p)
998979 } ,
999- def_ty_param ( i, _) => return Generic ( i. node ) ,
1000- def_struct ( i) => i,
1001- def_typaram_binder ( i) => {
980+ DefTyParam ( i, _) => return Generic ( i. node ) ,
981+ DefStruct ( i) => i,
982+ DefTyParamBinder ( i) => {
1002983 debug ! ( "found a typaram_binder, what is it? %d" , i) ;
1003984 return TyParamBinder ( i) ;
1004985 } ,
@@ -1011,10 +992,10 @@ fn resolve_type(t: &Type) -> Type {
1011992 let mut ty = ~"";
1012993 do csearch:: each_path ( sess. cstore , def_id. crate ) |pathstr, deflike, _vis| {
1013994 match deflike {
1014- decoder:: dl_def ( di) => {
995+ decoder:: DlDef ( di) => {
1015996 let d2 = match di {
1016- def_fn ( i, _) | def_ty ( i) | def_trait ( i) |
1017- def_struct ( i) | def_mod ( i) => Some ( i) ,
997+ DefFn ( i, _) | DefTy ( i) | DefTrait ( i) |
998+ DefStruct ( i) | DefMod ( i) => Some ( i) ,
1018999 _ => None ,
10191000 } ;
10201001 if d2. is_some ( ) {
@@ -1023,10 +1004,10 @@ fn resolve_type(t: &Type) -> Type {
10231004 debug ! ( "found external def: %?" , di) ;
10241005 path = pathstr. to_owned ( ) ;
10251006 ty = match di {
1026- def_fn ( * ) => ~"fn ",
1027- def_ty ( * ) => ~"enum ",
1028- def_trait ( * ) => ~"trait ",
1029- def_prim_ty ( p) => match p {
1007+ DefFn ( * ) => ~"fn ",
1008+ DefTy ( * ) => ~"enum ",
1009+ DefTrait ( * ) => ~"trait ",
1010+ DefPrimTy ( p) => match p {
10301011 ty_str => ~"str",
10311012 ty_bool => ~"bool",
10321013 ty_int( t) => match t. to_str ( ) {
@@ -1036,9 +1017,9 @@ fn resolve_type(t: &Type) -> Type {
10361017 ty_uint( t) => t. to_str ( ) ,
10371018 ty_float( t) => t. to_str ( )
10381019 } ,
1039- def_ty_param ( * ) => ~"generic",
1040- def_struct ( * ) => ~"struct ",
1041- def_typaram_binder ( * ) => ~"typaram_binder",
1020+ DefTyParam ( * ) => ~"generic",
1021+ DefStruct ( * ) => ~"struct ",
1022+ DefTyParamBinder ( * ) => ~"typaram_binder",
10421023 x => fail ! ( "resolved external maps to a weird def %?" , x) ,
10431024 } ;
10441025
0 commit comments