@@ -71,7 +71,7 @@ impl Clean<Crate> for visit_ast::RustdocVisitor {
71
71
Crate {
72
72
name : match maybe_meta {
73
73
Some ( x) => x. to_owned ( ) ,
74
- None => fail ! ( "rustdoc_ng requires a #[link(name=\" foo\" )] crate attribute" ) ,
74
+ None => fail2 ! ( "rustdoc_ng requires a \\ #[link(name=\" foo\" )] crate attribute" ) ,
75
75
} ,
76
76
module : Some ( self . module . clean ( ) ) ,
77
77
}
@@ -575,9 +575,9 @@ pub enum Type {
575
575
impl Clean < Type > for ast:: Ty {
576
576
fn clean ( & self ) -> Type {
577
577
use syntax:: ast:: * ;
578
- debug ! ( "cleaning type `%? `" , self ) ;
578
+ debug2 ! ( "cleaning type `{:?} `" , self ) ;
579
579
let codemap = local_data:: get ( super :: ctxtkey, |x| * x. unwrap ( ) ) . sess . codemap ;
580
- debug ! ( "span corresponds to `%s `" , codemap. span_to_str( self . span) ) ;
580
+ debug2 ! ( "span corresponds to `{} `" , codemap. span_to_str( self . span) ) ;
581
581
match self . node {
582
582
ty_nil => Unit ,
583
583
ty_ptr( ref m) => RawPointer ( m. mutbl . clean ( ) , ~m. ty . clean ( ) ) ,
@@ -595,7 +595,7 @@ impl Clean<Type> for ast::Ty {
595
595
ty_closure( ref c) => Closure ( ~c. clean ( ) ) ,
596
596
ty_bare_fn( ref barefn) => BareFunction ( ~barefn. clean ( ) ) ,
597
597
ty_bot => Bottom ,
598
- ref x => fail ! ( "Unimplemented type %? " , x) ,
598
+ ref x => fail2 ! ( "Unimplemented type {:?} " , x) ,
599
599
}
600
600
}
601
601
}
@@ -873,7 +873,7 @@ pub struct Static {
873
873
874
874
impl Clean < Item > for doctree:: Static {
875
875
fn clean ( & self ) -> Item {
876
- debug ! ( "claning static %s: %? " , self . name. clean( ) , self ) ;
876
+ debug2 ! ( "claning static {}: {:?} " , self . name. clean( ) , self ) ;
877
877
Item {
878
878
name : Some ( self . name . clean ( ) ) ,
879
879
attrs : self . attrs . clean ( ) ,
@@ -1053,13 +1053,13 @@ trait ToSource {
1053
1053
1054
1054
impl ToSource for syntax:: codemap:: Span {
1055
1055
fn to_src ( & self ) -> ~str {
1056
- debug ! ( "converting span %? to snippet" , self . clean( ) ) ;
1056
+ debug2 ! ( "converting span {:?} to snippet" , self . clean( ) ) ;
1057
1057
let cm = local_data:: get ( super :: ctxtkey, |x| x. unwrap ( ) . clone ( ) ) . sess . codemap . clone ( ) ;
1058
1058
let sn = match cm. span_to_snippet ( * self ) {
1059
1059
Some ( x) => x,
1060
1060
None => ~""
1061
1061
} ;
1062
- debug ! ( "got snippet %s " , sn) ;
1062
+ debug2 ! ( "got snippet {} " , sn) ;
1063
1063
sn
1064
1064
}
1065
1065
}
@@ -1084,17 +1084,17 @@ fn name_from_pat(p: &ast::Pat) -> ~str {
1084
1084
PatWild => ~"_",
1085
1085
PatIdent ( _, ref p, _) => path_to_str ( p) ,
1086
1086
PatEnum ( ref p, _) => path_to_str ( p) ,
1087
- PatStruct ( * ) => fail ! ( "tried to get argument name from pat_struct, \
1087
+ PatStruct ( * ) => fail2 ! ( "tried to get argument name from pat_struct, \
1088
1088
which is not allowed in function arguments") ,
1089
1089
PatTup ( * ) => ~"( tuple arg NYI ) ",
1090
1090
PatBox ( p) => name_from_pat ( p) ,
1091
1091
PatUniq ( p) => name_from_pat ( p) ,
1092
1092
PatRegion ( p) => name_from_pat ( p) ,
1093
- PatLit ( * ) => fail ! ( "tried to get argument name from pat_lit, \
1093
+ PatLit ( * ) => fail2 ! ( "tried to get argument name from pat_lit, \
1094
1094
which is not allowed in function arguments") ,
1095
- PatRange ( * ) => fail ! ( "tried to get argument name from pat_range, \
1095
+ PatRange ( * ) => fail2 ! ( "tried to get argument name from pat_range, \
1096
1096
which is not allowed in function arguments") ,
1097
- PatVec ( * ) => fail ! ( "tried to get argument name from pat_vec, \
1097
+ PatVec ( * ) => fail2 ! ( "tried to get argument name from pat_vec, \
1098
1098
which is not allowed in function arguments")
1099
1099
}
1100
1100
}
@@ -1117,14 +1117,14 @@ fn resolve_type(path: Path, tpbs: Option<~[TyParamBound]>,
1117
1117
use syntax:: ast:: * ;
1118
1118
1119
1119
let dm = local_data:: get ( super :: ctxtkey, |x| * x. unwrap ( ) ) . tycx . def_map ;
1120
- debug ! ( "searching for %? in defmap" , id) ;
1120
+ debug2 ! ( "searching for {:?} in defmap" , id) ;
1121
1121
let d = match dm. find ( & id) {
1122
1122
Some ( k) => k,
1123
1123
None => {
1124
1124
let ctxt = local_data:: get ( super :: ctxtkey, |x| * x. unwrap ( ) ) ;
1125
- debug ! ( "could not find %? in defmap (`%s `)" , id,
1125
+ debug2 ! ( "could not find {:?} in defmap (`{} `)" , id,
1126
1126
syntax:: ast_map:: node_id_to_str( ctxt. tycx. items, id, ctxt. sess. intr( ) ) ) ;
1127
- fail ! ( "Unexpected failure: unresolved id not in defmap (this is a bug!)" )
1127
+ fail2 ! ( "Unexpected failure: unresolved id not in defmap (this is a bug!)" )
1128
1128
}
1129
1129
} ;
1130
1130
@@ -1133,7 +1133,7 @@ fn resolve_type(path: Path, tpbs: Option<~[TyParamBound]>,
1133
1133
DefSelf ( i) | DefSelfTy ( i) => return Self ( i) ,
1134
1134
DefTy ( i) => i,
1135
1135
DefTrait ( i) => {
1136
- debug ! ( "saw DefTrait in def_to_id" ) ;
1136
+ debug2 ! ( "saw DefTrait in def_to_id" ) ;
1137
1137
i
1138
1138
} ,
1139
1139
DefPrimTy ( p) => match p {
@@ -1144,10 +1144,10 @@ fn resolve_type(path: Path, tpbs: Option<~[TyParamBound]>,
1144
1144
DefTyParam ( i, _) => return Generic ( i. node ) ,
1145
1145
DefStruct ( i) => i,
1146
1146
DefTyParamBinder ( i) => {
1147
- debug ! ( "found a typaram_binder, what is it? %d " , i) ;
1147
+ debug2 ! ( "found a typaram_binder, what is it? {} " , i) ;
1148
1148
return TyParamBinder ( i) ;
1149
1149
} ,
1150
- x => fail ! ( "resolved type maps to a weird def %? " , x) ,
1150
+ x => fail2 ! ( "resolved type maps to a weird def {:?} " , x) ,
1151
1151
} ;
1152
1152
ResolvedPath { path : path, typarams : tpbs, did : def_id }
1153
1153
}
0 commit comments