@@ -71,9 +71,9 @@ use middle::ty;
71
71
use middle:: typeck:: infer:: { CoerceResult , resolve_type, Coercion } ;
72
72
use middle:: typeck:: infer:: combine:: { CombineFields , Combine } ;
73
73
use middle:: typeck:: infer:: sub:: Sub ;
74
- use middle:: typeck:: infer:: to_str:: InferStr ;
75
74
use middle:: typeck:: infer:: resolve:: try_resolve_tvar_shallow;
76
75
use util:: common:: indenter;
76
+ use util:: ppaux:: Repr ;
77
77
78
78
use syntax:: abi;
79
79
use syntax:: ast:: MutImmutable ;
@@ -91,8 +91,8 @@ impl<'f> Coerce<'f> {
91
91
92
92
pub fn tys ( & self , a : ty:: t , b : ty:: t ) -> CoerceResult {
93
93
debug ! ( "Coerce.tys({} => {})" ,
94
- a. inf_str ( self . get_ref( ) . infcx) ,
95
- b. inf_str ( self . get_ref( ) . infcx) ) ;
94
+ a. repr ( self . get_ref( ) . infcx. tcx ) ,
95
+ b. repr ( self . get_ref( ) . infcx. tcx ) ) ;
96
96
let _indent = indenter ( ) ;
97
97
98
98
// Examine the supertype and consider auto-borrowing.
@@ -233,8 +233,8 @@ impl<'f> Coerce<'f> {
233
233
mt_b : ty:: mt )
234
234
-> CoerceResult {
235
235
debug ! ( "coerce_borrowed_pointer(a={}, sty_a={:?}, b={}, mt_b={:?})" ,
236
- a. inf_str ( self . get_ref( ) . infcx) , sty_a,
237
- b. inf_str ( self . get_ref( ) . infcx) , mt_b) ;
236
+ a. repr ( self . get_ref( ) . infcx. tcx ) , sty_a,
237
+ b. repr ( self . get_ref( ) . infcx. tcx ) , mt_b) ;
238
238
239
239
// If we have a parameter of type `&M T_a` and the value
240
240
// provided is `expr`, we will be adding an implicit borrow,
@@ -270,8 +270,8 @@ impl<'f> Coerce<'f> {
270
270
b : ty:: t )
271
271
-> CoerceResult {
272
272
debug ! ( "coerce_borrowed_string(a={}, sty_a={:?}, b={})" ,
273
- a. inf_str ( self . get_ref( ) . infcx) , sty_a,
274
- b. inf_str ( self . get_ref( ) . infcx) ) ;
273
+ a. repr ( self . get_ref( ) . infcx. tcx ) , sty_a,
274
+ b. repr ( self . get_ref( ) . infcx. tcx ) ) ;
275
275
276
276
match * sty_a {
277
277
ty:: ty_uniq( t) => match ty:: get ( t) . sty {
@@ -300,8 +300,8 @@ impl<'f> Coerce<'f> {
300
300
mutbl_b : ast:: Mutability )
301
301
-> CoerceResult {
302
302
debug ! ( "coerce_borrowed_vector(a={}, sty_a={:?}, b={})" ,
303
- a. inf_str ( self . get_ref( ) . infcx) , sty_a,
304
- b. inf_str ( self . get_ref( ) . infcx) ) ;
303
+ a. repr ( self . get_ref( ) . infcx. tcx ) , sty_a,
304
+ b. repr ( self . get_ref( ) . infcx. tcx ) ) ;
305
305
306
306
let sub = Sub ( self . get_ref ( ) . clone ( ) ) ;
307
307
let coercion = Coercion ( self . get_ref ( ) . trace . clone ( ) ) ;
@@ -336,8 +336,8 @@ impl<'f> Coerce<'f> {
336
336
b_mutbl : ast:: Mutability ) -> CoerceResult
337
337
{
338
338
debug ! ( "coerce_borrowed_object(a={}, sty_a={:?}, b={})" ,
339
- a. inf_str ( self . get_ref( ) . infcx) , sty_a,
340
- b. inf_str ( self . get_ref( ) . infcx) ) ;
339
+ a. repr ( self . get_ref( ) . infcx. tcx ) , sty_a,
340
+ b. repr ( self . get_ref( ) . infcx. tcx ) ) ;
341
341
342
342
let tcx = self . get_ref ( ) . infcx . tcx ;
343
343
let coercion = Coercion ( self . get_ref ( ) . trace . clone ( ) ) ;
@@ -376,8 +376,8 @@ impl<'f> Coerce<'f> {
376
376
b : ty:: t )
377
377
-> CoerceResult {
378
378
debug ! ( "coerce_borrowed_fn(a={}, sty_a={:?}, b={})" ,
379
- a. inf_str ( self . get_ref( ) . infcx) , sty_a,
380
- b. inf_str ( self . get_ref( ) . infcx) ) ;
379
+ a. repr ( self . get_ref( ) . infcx. tcx ) , sty_a,
380
+ b. repr ( self . get_ref( ) . infcx. tcx ) ) ;
381
381
382
382
match * sty_a {
383
383
ty:: ty_bare_fn( ref f) => {
@@ -400,7 +400,7 @@ impl<'f> Coerce<'f> {
400
400
self . unpack_actual_value ( b, |sty_b| {
401
401
402
402
debug ! ( "coerce_from_bare_fn(a={}, b={})" ,
403
- a. inf_str ( self . get_ref( ) . infcx) , b. inf_str ( self . get_ref( ) . infcx) ) ;
403
+ a. repr ( self . get_ref( ) . infcx. tcx ) , b. repr ( self . get_ref( ) . infcx. tcx ) ) ;
404
404
405
405
if fn_ty_a. abi != abi:: Rust || fn_ty_a. fn_style != ast:: NormalFn {
406
406
return self . subtype ( a, b) ;
@@ -429,8 +429,8 @@ impl<'f> Coerce<'f> {
429
429
mt_b : ty:: mt )
430
430
-> CoerceResult {
431
431
debug ! ( "coerce_unsafe_ptr(a={}, sty_a={:?}, b={})" ,
432
- a. inf_str ( self . get_ref( ) . infcx) , sty_a,
433
- b. inf_str ( self . get_ref( ) . infcx) ) ;
432
+ a. repr ( self . get_ref( ) . infcx. tcx ) , sty_a,
433
+ b. repr ( self . get_ref( ) . infcx. tcx ) ) ;
434
434
435
435
let mt_a = match * sty_a {
436
436
ty:: ty_rptr( _, mt) => mt,
@@ -462,8 +462,8 @@ impl<'f> Coerce<'f> {
462
462
bounds : ty:: BuiltinBounds ) -> CoerceResult {
463
463
464
464
debug ! ( "coerce_object(a={}, sty_a={:?}, b={})" ,
465
- a. inf_str ( self . get_ref( ) . infcx) , sty_a,
466
- b. inf_str ( self . get_ref( ) . infcx) ) ;
465
+ a. repr ( self . get_ref( ) . infcx. tcx ) , sty_a,
466
+ b. repr ( self . get_ref( ) . infcx. tcx ) ) ;
467
467
468
468
Ok ( Some ( ty:: AutoObject ( trait_store, bounds,
469
469
trait_def_id, trait_substs. clone ( ) ) ) )
0 commit comments