@@ -15,7 +15,6 @@ use self::UnsafeContext::*;
15
15
use middle:: def;
16
16
use middle:: ty:: { self , Ty } ;
17
17
use middle:: ty:: MethodCall ;
18
- use util:: ppaux;
19
18
20
19
use syntax:: ast;
21
20
use syntax:: codemap:: Span ;
@@ -66,8 +65,8 @@ impl<'a, 'tcx> EffectCheckVisitor<'a, 'tcx> {
66
65
ast:: ExprIndex ( ref base, _) => ty:: node_id_to_type ( self . tcx , base. id ) ,
67
66
_ => return
68
67
} ;
69
- debug ! ( "effect: checking index with base type {}" ,
70
- ppaux :: ty_to_string ( self . tcx , base_type) ) ;
68
+ debug ! ( "effect: checking index with base type {:? }" ,
69
+ base_type) ;
71
70
match base_type. sty {
72
71
ty:: TyBox ( ty) | ty:: TyRef ( _, ty:: mt { ty, ..} ) => if ty:: TyStr == ty. sty {
73
72
span_err ! ( self . tcx. sess, e. span, E0134 ,
@@ -142,25 +141,25 @@ impl<'a, 'tcx, 'v> Visitor<'v> for EffectCheckVisitor<'a, 'tcx> {
142
141
ast:: ExprMethodCall ( _, _, _) => {
143
142
let method_call = MethodCall :: expr ( expr. id ) ;
144
143
let base_type = self . tcx . method_map . borrow ( ) . get ( & method_call) . unwrap ( ) . ty ;
145
- debug ! ( "effect: method call case, base type is {}" ,
146
- ppaux :: ty_to_string ( self . tcx , base_type) ) ;
144
+ debug ! ( "effect: method call case, base type is {:? }" ,
145
+ base_type) ;
147
146
if type_is_unsafe_function ( base_type) {
148
147
self . require_unsafe ( expr. span ,
149
148
"invocation of unsafe method" )
150
149
}
151
150
}
152
151
ast:: ExprCall ( ref base, _) => {
153
152
let base_type = ty:: node_id_to_type ( self . tcx , base. id ) ;
154
- debug ! ( "effect: call case, base type is {}" ,
155
- ppaux :: ty_to_string ( self . tcx , base_type) ) ;
153
+ debug ! ( "effect: call case, base type is {:? }" ,
154
+ base_type) ;
156
155
if type_is_unsafe_function ( base_type) {
157
156
self . require_unsafe ( expr. span , "call to unsafe function" )
158
157
}
159
158
}
160
159
ast:: ExprUnary ( ast:: UnDeref , ref base) => {
161
160
let base_type = ty:: node_id_to_type ( self . tcx , base. id ) ;
162
- debug ! ( "effect: unary case, base type is {}" ,
163
- ppaux :: ty_to_string ( self . tcx , base_type) ) ;
161
+ debug ! ( "effect: unary case, base type is {:? }" ,
162
+ base_type) ;
164
163
if let ty:: TyRawPtr ( _) = base_type. sty {
165
164
self . require_unsafe ( expr. span , "dereference of raw pointer" )
166
165
}
0 commit comments