Skip to content

Commit 9a278f4

Browse files
committed
rustc: merge PrintCx::parameterized and def_path printing.
1 parent fb94c06 commit 9a278f4

File tree

9 files changed

+445
-297
lines changed

9 files changed

+445
-297
lines changed

src/librustc/infer/error_reporting/mod.rs

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

0 commit comments

Comments
 (0)