Skip to content

Commit 3fe1efd

Browse files
committed
rustc: remove the ability for pretty-printers to override nesting.
1 parent 6b42110 commit 3fe1efd

File tree

3 files changed

+68
-75
lines changed

3 files changed

+68
-75
lines changed

src/librustc/infer/error_reporting/nice_region_error/placeholder_error.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use traits::{ObligationCause, ObligationCauseCode};
88
use ty;
99
use ty::error::ExpectedFound;
1010
use ty::subst::Substs;
11-
use ty::print::{Print, PrettyPrinter};
11+
use ty::print::Print;
1212
use util::common::ErrorReported;
1313

1414
use 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

Comments
 (0)