Skip to content

Commit a15bfc6

Browse files
committed
rustc: merge PrintCx::parameterized and def_path printing.
1 parent b0fbca9 commit a15bfc6

File tree

8 files changed

+473
-333
lines changed

8 files changed

+473
-333
lines changed

src/librustc/infer/error_reporting/mod.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,8 +450,11 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
450450
if !(did1.is_local() || did2.is_local()) && did1.krate != did2.krate {
451451
let exp_path = self.tcx.def_path_str(did1);
452452
let found_path = self.tcx.def_path_str(did2);
453-
let exp_abs_path = self.tcx.absolute_def_path_str(did1);
454-
let found_abs_path = self.tcx.absolute_def_path_str(did2);
453+
// HACK(eddyb) switch form `with_forced_absolute_paths`
454+
// to a custom implementation of `ty::print::Printer`.
455+
let (exp_abs_path, found_abs_path) = ty::print::with_forced_absolute_paths(|| {
456+
(self.tcx.def_path_str(did1), self.tcx.def_path_str(did2))
457+
});
455458
// We compare strings because DefPath can be different
456459
// for imported and non-imported crates
457460
if exp_path == found_path || exp_abs_path == found_abs_path {

src/librustc/ty/print.rs

Lines changed: 234 additions & 95 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)