@@ -657,7 +657,7 @@ impl Clean<VariantKind> for ast::variant_kind {
657
657
}
658
658
}
659
659
660
- impl Clean < ~str > for syntax:: codemap:: span {
660
+ impl Clean < ~str > for syntax:: codemap:: Span {
661
661
fn clean ( & self ) -> ~str {
662
662
let cm = local_data:: get ( super :: ctxtkey, |x| x. unwrap ( ) . clone ( ) ) . sess . codemap ;
663
663
cm. span_to_str ( * self )
@@ -697,7 +697,7 @@ fn path_to_str(p: &ast::Path) -> ~str {
697
697
s
698
698
}
699
699
700
- impl Clean < ~str > for ast:: ident {
700
+ impl Clean < ~str > for ast:: Ident {
701
701
fn clean ( & self ) -> ~str {
702
702
its ( self ) . to_owned ( )
703
703
}
@@ -779,15 +779,13 @@ impl Clean<Item> for doctree::Static {
779
779
pub enum Mutability {
780
780
Mutable ,
781
781
Immutable ,
782
- Const ,
783
782
}
784
783
785
- impl Clean < Mutability > for ast:: mutability {
784
+ impl Clean < Mutability > for ast:: Mutability {
786
785
fn clean ( & self ) -> Mutability {
787
786
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 ,
791
789
}
792
790
}
793
791
}
@@ -885,7 +883,7 @@ trait ToSource {
885
883
fn to_src ( & self ) -> ~str ;
886
884
}
887
885
888
- impl ToSource for syntax:: codemap:: span {
886
+ impl ToSource for syntax:: codemap:: Span {
889
887
fn to_src ( & self ) -> ~str {
890
888
debug ! ( "converting span %s to snippet" , self . clean( ) ) ;
891
889
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 {
912
910
}
913
911
}
914
912
915
- fn name_from_pat ( p: & ast:: pat ) -> ~str {
913
+ fn name_from_pat ( p: & ast:: Pat ) -> ~str {
916
914
use syntax:: ast:: * ;
917
915
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, \
932
930
which is not allowed in function arguments")
933
931
}
934
932
}
@@ -945,23 +943,6 @@ fn remove_comment_tags(s: &str) -> ~str {
945
943
}
946
944
}
947
945
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
-
965
946
/// Given a Type, resolve it using the def_map
966
947
fn resolve_type( t : & Type ) -> Type {
967
948
use syntax:: ast:: * ;
@@ -984,21 +965,21 @@ fn resolve_type(t: &Type) -> Type {
984
965
} ;
985
966
986
967
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" ) ;
992
973
i
993
974
} ,
994
- def_prim_ty ( p) => match p {
975
+ DefPrimTy ( p) => match p {
995
976
ty_str => return String ,
996
977
ty_bool => return Bool ,
997
978
_ => return Primitive ( p)
998
979
} ,
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) => {
1002
983
debug ! ( "found a typaram_binder, what is it? %d" , i) ;
1003
984
return TyParamBinder ( i) ;
1004
985
} ,
@@ -1011,10 +992,10 @@ fn resolve_type(t: &Type) -> Type {
1011
992
let mut ty = ~"";
1012
993
do csearch:: each_path ( sess. cstore , def_id. crate ) |pathstr, deflike, _vis| {
1013
994
match deflike {
1014
- decoder:: dl_def ( di) => {
995
+ decoder:: DlDef ( di) => {
1015
996
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) ,
1018
999
_ => None ,
1019
1000
} ;
1020
1001
if d2. is_some ( ) {
@@ -1023,10 +1004,10 @@ fn resolve_type(t: &Type) -> Type {
1023
1004
debug ! ( "found external def: %?" , di) ;
1024
1005
path = pathstr. to_owned ( ) ;
1025
1006
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 {
1030
1011
ty_str => ~"str",
1031
1012
ty_bool => ~"bool",
1032
1013
ty_int( t) => match t. to_str ( ) {
@@ -1036,9 +1017,9 @@ fn resolve_type(t: &Type) -> Type {
1036
1017
ty_uint( t) => t. to_str ( ) ,
1037
1018
ty_float( t) => t. to_str ( )
1038
1019
} ,
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",
1042
1023
x => fail ! ( "resolved external maps to a weird def %?" , x) ,
1043
1024
} ;
1044
1025
0 commit comments