@@ -27,7 +27,6 @@ use middle::ty::{self};
27
27
use middle:: ty:: { MethodCall , MethodObject , MethodTraitObject } ;
28
28
use middle:: ty:: { MethodOrigin , MethodParam , MethodTypeParam } ;
29
29
use middle:: ty:: { MethodStatic , MethodStaticClosure } ;
30
- use util:: ppaux:: Repr ;
31
30
32
31
use syntax:: { ast, ast_util} ;
33
32
use syntax:: ptr:: P ;
@@ -362,8 +361,8 @@ impl<'d,'t,'tcx,TYPER:mc::Typer<'tcx>> ExprUseVisitor<'d,'t,'tcx,TYPER> {
362
361
consume_id : ast:: NodeId ,
363
362
consume_span : Span ,
364
363
cmt : mc:: cmt < ' tcx > ) {
365
- debug ! ( "delegate_consume(consume_id={}, cmt={})" ,
366
- consume_id, cmt. repr ( ) ) ;
364
+ debug ! ( "delegate_consume(consume_id={}, cmt={:? })" ,
365
+ consume_id, cmt) ;
367
366
368
367
let mode = copy_or_move ( self . typer , & cmt, DirectRefMove ) ;
369
368
self . delegate . consume ( consume_id, consume_span, cmt, mode) ;
@@ -376,7 +375,7 @@ impl<'d,'t,'tcx,TYPER:mc::Typer<'tcx>> ExprUseVisitor<'d,'t,'tcx,TYPER> {
376
375
}
377
376
378
377
pub fn consume_expr ( & mut self , expr : & ast:: Expr ) {
379
- debug ! ( "consume_expr(expr={})" , expr. repr ( ) ) ;
378
+ debug ! ( "consume_expr(expr={:? })" , expr) ;
380
379
381
380
let cmt = return_if_err ! ( self . mc. cat_expr( expr) ) ;
382
381
self . delegate_consume ( expr. id , expr. span , cmt) ;
@@ -397,8 +396,8 @@ impl<'d,'t,'tcx,TYPER:mc::Typer<'tcx>> ExprUseVisitor<'d,'t,'tcx,TYPER> {
397
396
r : ty:: Region ,
398
397
bk : ty:: BorrowKind ,
399
398
cause : LoanCause ) {
400
- debug ! ( "borrow_expr(expr={}, r={}, bk={})" ,
401
- expr. repr ( ) , r. repr ( ) , bk. repr ( ) ) ;
399
+ debug ! ( "borrow_expr(expr={:? }, r={:? }, bk={:? })" ,
400
+ expr, r, bk) ;
402
401
403
402
let cmt = return_if_err ! ( self . mc. cat_expr( expr) ) ;
404
403
self . delegate . borrow ( expr. id , expr. span , cmt, r, bk, cause) ;
@@ -414,7 +413,7 @@ impl<'d,'t,'tcx,TYPER:mc::Typer<'tcx>> ExprUseVisitor<'d,'t,'tcx,TYPER> {
414
413
}
415
414
416
415
pub fn walk_expr ( & mut self , expr : & ast:: Expr ) {
417
- debug ! ( "walk_expr(expr={})" , expr. repr ( ) ) ;
416
+ debug ! ( "walk_expr(expr={:? })" , expr) ;
418
417
419
418
self . walk_adjustment ( expr) ;
420
419
@@ -618,8 +617,8 @@ impl<'d,'t,'tcx,TYPER:mc::Typer<'tcx>> ExprUseVisitor<'d,'t,'tcx,TYPER> {
618
617
619
618
fn walk_callee ( & mut self , call : & ast:: Expr , callee : & ast:: Expr ) {
620
619
let callee_ty = return_if_err ! ( self . typer. expr_ty_adjusted( callee) ) ;
621
- debug ! ( "walk_callee: callee={} callee_ty={}" ,
622
- callee. repr ( ) , callee_ty. repr ( ) ) ;
620
+ debug ! ( "walk_callee: callee={:? } callee_ty={:? }" ,
621
+ callee, callee_ty) ;
623
622
let call_scope = region:: CodeExtent :: from_node_id ( call. id ) ;
624
623
match callee_ty. sty {
625
624
ty:: TyBareFn ( ..) => {
@@ -637,7 +636,7 @@ impl<'d,'t,'tcx,TYPER:mc::Typer<'tcx>> ExprUseVisitor<'d,'t,'tcx,TYPER> {
637
636
None => {
638
637
self . tcx ( ) . sess . span_bug (
639
638
callee. span ,
640
- & format ! ( "unexpected callee type {}" , callee_ty. repr ( ) ) )
639
+ & format ! ( "unexpected callee type {}" , callee_ty) )
641
640
}
642
641
} ;
643
642
match overloaded_call_type {
@@ -811,7 +810,7 @@ impl<'d,'t,'tcx,TYPER:mc::Typer<'tcx>> ExprUseVisitor<'d,'t,'tcx,TYPER> {
811
810
fn walk_autoderefs ( & mut self ,
812
811
expr : & ast:: Expr ,
813
812
autoderefs : usize ) {
814
- debug ! ( "walk_autoderefs expr={} autoderefs={}" , expr. repr ( ) , autoderefs) ;
813
+ debug ! ( "walk_autoderefs expr={:? } autoderefs={}" , expr, autoderefs) ;
815
814
816
815
for i in 0 ..autoderefs {
817
816
let deref_id = ty:: MethodCall :: autoderef ( expr. id , i as u32 ) ;
@@ -828,8 +827,8 @@ impl<'d,'t,'tcx,TYPER:mc::Typer<'tcx>> ExprUseVisitor<'d,'t,'tcx,TYPER> {
828
827
let ( m, r) = match self_ty. sty {
829
828
ty:: TyRef ( r, ref m) => ( m. mutbl , r) ,
830
829
_ => self . tcx ( ) . sess . span_bug ( expr. span ,
831
- & format ! ( "bad overloaded deref type {}" ,
832
- method_ty. repr ( ) ) )
830
+ & format ! ( "bad overloaded deref type {:? }" ,
831
+ method_ty) )
833
832
} ;
834
833
let bk = ty:: BorrowKind :: from_mutbl ( m) ;
835
834
self . delegate . borrow ( expr. id , expr. span , cmt,
@@ -842,9 +841,9 @@ impl<'d,'t,'tcx,TYPER:mc::Typer<'tcx>> ExprUseVisitor<'d,'t,'tcx,TYPER> {
842
841
fn walk_autoderefref ( & mut self ,
843
842
expr : & ast:: Expr ,
844
843
adj : & ty:: AutoDerefRef < ' tcx > ) {
845
- debug ! ( "walk_autoderefref expr={} adj={}" ,
846
- expr. repr ( ) ,
847
- adj. repr ( ) ) ;
844
+ debug ! ( "walk_autoderefref expr={:? } adj={:? }" ,
845
+ expr,
846
+ adj) ;
848
847
849
848
self . walk_autoderefs ( expr, adj. autoderefs ) ;
850
849
@@ -875,9 +874,9 @@ impl<'d,'t,'tcx,TYPER:mc::Typer<'tcx>> ExprUseVisitor<'d,'t,'tcx,TYPER> {
875
874
opt_autoref : Option < ty:: AutoRef < ' tcx > > )
876
875
-> mc:: cmt < ' tcx >
877
876
{
878
- debug ! ( "walk_autoref(expr.id={} cmt_derefd={} opt_autoref={:?})" ,
877
+ debug ! ( "walk_autoref(expr.id={} cmt_derefd={:? } opt_autoref={:?})" ,
879
878
expr. id,
880
- cmt_base. repr ( ) ,
879
+ cmt_base,
881
880
opt_autoref) ;
882
881
883
882
let cmt_base_ty = cmt_base. ty ;
@@ -901,9 +900,9 @@ impl<'d,'t,'tcx,TYPER:mc::Typer<'tcx>> ExprUseVisitor<'d,'t,'tcx,TYPER> {
901
900
}
902
901
903
902
ty:: AutoUnsafe ( m) => {
904
- debug ! ( "walk_autoref: expr.id={} cmt_base={}" ,
903
+ debug ! ( "walk_autoref: expr.id={} cmt_base={:? }" ,
905
904
expr. id,
906
- cmt_base. repr ( ) ) ;
905
+ cmt_base) ;
907
906
908
907
// Converting from a &T to *T (or &mut T to *mut T) is
909
908
// treated as borrowing it for the enclosing temporary
@@ -1011,8 +1010,8 @@ impl<'d,'t,'tcx,TYPER:mc::Typer<'tcx>> ExprUseVisitor<'d,'t,'tcx,TYPER> {
1011
1010
cmt_discr : mc:: cmt < ' tcx > ,
1012
1011
pat : & ast:: Pat ,
1013
1012
mode : & mut TrackMatchMode ) {
1014
- debug ! ( "determine_pat_move_mode cmt_discr={} pat={}" , cmt_discr. repr ( ) ,
1015
- pat. repr ( ) ) ;
1013
+ debug ! ( "determine_pat_move_mode cmt_discr={:? } pat={:? }" , cmt_discr,
1014
+ pat) ;
1016
1015
return_if_err ! ( self . mc. cat_pattern( cmt_discr, pat, |_mc, cmt_pat, pat| {
1017
1016
let tcx = self . tcx( ) ;
1018
1017
let def_map = & self . tcx( ) . def_map;
@@ -1043,8 +1042,8 @@ impl<'d,'t,'tcx,TYPER:mc::Typer<'tcx>> ExprUseVisitor<'d,'t,'tcx,TYPER> {
1043
1042
cmt_discr : mc:: cmt < ' tcx > ,
1044
1043
pat : & ast:: Pat ,
1045
1044
match_mode : MatchMode ) {
1046
- debug ! ( "walk_pat cmt_discr={} pat={}" , cmt_discr. repr ( ) ,
1047
- pat. repr ( ) ) ;
1045
+ debug ! ( "walk_pat cmt_discr={:? } pat={:? }" , cmt_discr,
1046
+ pat) ;
1048
1047
1049
1048
let mc = & self . mc ;
1050
1049
let typer = self . typer ;
@@ -1054,9 +1053,9 @@ impl<'d,'t,'tcx,TYPER:mc::Typer<'tcx>> ExprUseVisitor<'d,'t,'tcx,TYPER> {
1054
1053
if pat_util:: pat_is_binding( def_map, pat) {
1055
1054
let tcx = typer. tcx( ) ;
1056
1055
1057
- debug!( "binding cmt_pat={} pat={} match_mode={:?}" ,
1058
- cmt_pat. repr ( ) ,
1059
- pat. repr ( ) ,
1056
+ debug!( "binding cmt_pat={:? } pat={:? } match_mode={:?}" ,
1057
+ cmt_pat,
1058
+ pat,
1060
1059
match_mode) ;
1061
1060
1062
1061
// pat_ty: the type of the binding being produced.
@@ -1160,9 +1159,9 @@ impl<'d,'t,'tcx,TYPER:mc::Typer<'tcx>> ExprUseVisitor<'d,'t,'tcx,TYPER> {
1160
1159
mc. cat_downcast( pat, cmt_pat, cmt_pat_ty, variant_did)
1161
1160
} ;
1162
1161
1163
- debug!( "variant downcast_cmt={} pat={}" ,
1164
- downcast_cmt. repr ( ) ,
1165
- pat. repr ( ) ) ;
1162
+ debug!( "variant downcast_cmt={:? } pat={:? }" ,
1163
+ downcast_cmt,
1164
+ pat) ;
1166
1165
1167
1166
delegate. matched_pat( pat, downcast_cmt, match_mode) ;
1168
1167
}
@@ -1172,9 +1171,9 @@ impl<'d,'t,'tcx,TYPER:mc::Typer<'tcx>> ExprUseVisitor<'d,'t,'tcx,TYPER> {
1172
1171
// namespace; we encounter the former on
1173
1172
// e.g. patterns for unit structs).
1174
1173
1175
- debug!( "struct cmt_pat={} pat={}" ,
1176
- cmt_pat. repr ( ) ,
1177
- pat. repr ( ) ) ;
1174
+ debug!( "struct cmt_pat={:? } pat={:? }" ,
1175
+ cmt_pat,
1176
+ pat) ;
1178
1177
1179
1178
delegate. matched_pat( pat, cmt_pat, match_mode) ;
1180
1179
}
@@ -1192,9 +1191,9 @@ impl<'d,'t,'tcx,TYPER:mc::Typer<'tcx>> ExprUseVisitor<'d,'t,'tcx,TYPER> {
1192
1191
// pattern.
1193
1192
1194
1193
if !tcx. sess. has_errors( ) {
1195
- let msg = format!( "Pattern has unexpected type: {:?} and type {}" ,
1194
+ let msg = format!( "Pattern has unexpected type: {:?} and type {:? }" ,
1196
1195
def,
1197
- cmt_pat. ty. repr ( ) ) ;
1196
+ cmt_pat. ty) ;
1198
1197
tcx. sess. span_bug( pat. span, & msg)
1199
1198
}
1200
1199
}
@@ -1209,9 +1208,9 @@ impl<'d,'t,'tcx,TYPER:mc::Typer<'tcx>> ExprUseVisitor<'d,'t,'tcx,TYPER> {
1209
1208
// reported.
1210
1209
1211
1210
if !tcx. sess. has_errors( ) {
1212
- let msg = format!( "Pattern has unexpected def: {:?} and type {}" ,
1211
+ let msg = format!( "Pattern has unexpected def: {:?} and type {:? }" ,
1213
1212
def,
1214
- cmt_pat. ty. repr ( ) ) ;
1213
+ cmt_pat. ty) ;
1215
1214
tcx. sess. span_bug( pat. span, & msg[ ..] )
1216
1215
}
1217
1216
}
@@ -1237,7 +1236,7 @@ impl<'d,'t,'tcx,TYPER:mc::Typer<'tcx>> ExprUseVisitor<'d,'t,'tcx,TYPER> {
1237
1236
}
1238
1237
1239
1238
fn walk_captures ( & mut self , closure_expr : & ast:: Expr ) {
1240
- debug ! ( "walk_captures({})" , closure_expr. repr ( ) ) ;
1239
+ debug ! ( "walk_captures({:? })" , closure_expr) ;
1241
1240
1242
1241
ty:: with_freevars ( self . tcx ( ) , closure_expr. id , |freevars| {
1243
1242
for freevar in freevars {
0 commit comments