1
Fork 0

Disable visible path calculation for PrettyPrinter in Ok path of compiler

This commit is contained in:
Alik Aslanyan 2021-09-20 20:22:55 +04:00
parent db1fb85cff
commit 9da27f0429
No known key found for this signature in database
GPG key ID: 7FE6FD5D5BC4CCF6
10 changed files with 54 additions and 29 deletions

View file

@ -321,10 +321,13 @@ macro_rules! define_queries {
pub fn $name<$tcx>(tcx: QueryCtxt<$tcx>, key: query_keys::$name<$tcx>) -> QueryStackFrame {
let kind = dep_graph::DepKind::$name;
let name = stringify!($name);
let description = ty::print::with_forced_impl_filename_line(
// Disable visible paths printing for performance reasons.
// Showing visible path instead of any path is not that important in production.
let description = ty::print::with_no_visible_paths(
|| ty::print::with_forced_impl_filename_line(
// Force filename-line mode to avoid invoking `type_of` query.
|| queries::$name::describe(tcx, key)
);
));
let description = if tcx.sess.verbose() {
format!("{} [{}]", description, name)
} else {