@@ -8,7 +8,7 @@ use traits::{ObligationCause, ObligationCauseCode};
88use ty;
99use ty:: error:: ExpectedFound ;
1010use ty:: subst:: Substs ;
11- use ty:: print:: { Print , PrettyPrinter } ;
11+ use ty:: print:: Print ;
1212use util:: common:: ErrorReported ;
1313
1414use std:: fmt:: Write ;
@@ -253,9 +253,11 @@ impl NiceRegionError<'me, 'gcx, 'tcx> {
253253 let _ = ( || {
254254 let mut cx = ty:: print:: PrintCx :: new ( self . tcx , printer) ;
255255 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) ?) ;
257258 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) ?) ;
259261 write ! ( cx, "`" )
260262 } ) ( ) ;
261263
@@ -287,9 +289,11 @@ impl NiceRegionError<'me, 'gcx, 'tcx> {
287289 let _ = ( || {
288290 let mut cx = ty:: print:: PrintCx :: new ( self . tcx , printer) ;
289291 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) ?) ;
291294 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) ?) ;
293297 write ! ( cx, "`" )
294298 } ) ( ) ;
295299
0 commit comments