@@ -8,7 +8,7 @@ use traits::{ObligationCause, ObligationCauseCode};
8
8
use ty;
9
9
use ty:: error:: ExpectedFound ;
10
10
use ty:: subst:: Substs ;
11
- use ty:: print:: { Print , PrettyPrinter } ;
11
+ use ty:: print:: Print ;
12
12
use util:: common:: ErrorReported ;
13
13
14
14
use std:: fmt:: Write ;
@@ -253,9 +253,11 @@ impl NiceRegionError<'me, 'gcx, 'tcx> {
253
253
let _ = ( || {
254
254
let mut cx = ty:: print:: PrintCx :: new ( self . tcx , printer) ;
255
255
write ! ( cx, "`" ) ?;
256
- cx = cx. nest ( |cx| expected_trait_ref. self_ty ( ) . print ( cx) ) ?;
256
+ cx = ty:: print:: PrintCx :: new ( self . tcx ,
257
+ expected_trait_ref. self_ty ( ) . print ( cx) ?) ;
257
258
write ! ( cx, "` must implement `" ) ?;
258
- cx = cx. nest ( |cx| expected_trait_ref. print ( cx) ) ?;
259
+ cx = ty:: print:: PrintCx :: new ( self . tcx ,
260
+ expected_trait_ref. print ( cx) ?) ;
259
261
write ! ( cx, "`" )
260
262
} ) ( ) ;
261
263
@@ -287,9 +289,11 @@ impl NiceRegionError<'me, 'gcx, 'tcx> {
287
289
let _ = ( || {
288
290
let mut cx = ty:: print:: PrintCx :: new ( self . tcx , printer) ;
289
291
write ! ( cx, "but `" ) ?;
290
- cx = cx. nest ( |cx| actual_trait_ref. self_ty ( ) . print ( cx) ) ?;
292
+ cx = ty:: print:: PrintCx :: new ( self . tcx ,
293
+ actual_trait_ref. self_ty ( ) . print ( cx) ?) ;
291
294
write ! ( cx, "` only implements `" ) ?;
292
- cx = cx. nest ( |cx| actual_trait_ref. print ( cx) ) ?;
295
+ cx = ty:: print:: PrintCx :: new ( self . tcx ,
296
+ actual_trait_ref. print ( cx) ?) ;
293
297
write ! ( cx, "`" )
294
298
} ) ( ) ;
295
299
0 commit comments