1
Fork 0

Rollup merge of #77605 - da-x:fix-rustc-def-path, r=petrochenkov

Fix rustc_def_path to show the full path and not the trimmed one

Follow-up fix for #73996.
This commit is contained in:
Dylan DPC 2020-10-07 00:16:12 +02:00 committed by GitHub
commit 207832bdc0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 5 deletions

View file

@ -5,6 +5,7 @@
//! paths etc in all kinds of annoying scenarios.
use rustc_hir as hir;
use rustc_middle::ty::print::with_no_trimmed_paths;
use rustc_middle::ty::{Instance, TyCtxt};
use rustc_span::symbol::{sym, Symbol};
@ -44,7 +45,7 @@ impl SymbolNamesTest<'tcx> {
tcx.sess.span_err(attr.span, &format!("demangling-alt({:#})", demangling));
}
} else if tcx.sess.check_name(attr, DEF_PATH) {
let path = tcx.def_path_str(def_id.to_def_id());
let path = with_no_trimmed_paths(|| tcx.def_path_str(def_id.to_def_id()));
tcx.sess.span_err(attr.span, &format!("def-path({})", path));
}