1
Fork 0

Move ty::print methods to Drop-based scope guards

This commit is contained in:
Mark Rousskov 2022-02-16 13:04:48 -05:00
parent 393fdc1048
commit 9763486034
30 changed files with 142 additions and 142 deletions

View file

@ -272,11 +272,12 @@ macro_rules! define_queries {
let name = stringify!($name);
// 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(
let description = ty::print::with_no_visible_paths!(
// Force filename-line mode to avoid invoking `type_of` query.
|| queries::$name::describe(tcx, key)
));
ty::print::with_forced_impl_filename_line!(
queries::$name::describe(tcx, key)
)
);
let description = if tcx.sess.verbose() {
format!("{} [{}]", description, name)
} else {