Rollup merge of #126674 - oli-obk:tracing_item_bounds, r=lqd

Allow tracing through item_bounds query invocations on opaques

Previously these caused cycles when printing the result of the query.
This commit is contained in:
fee1-dead 2024-06-19 22:51:04 +08:00 committed by GitHub
commit cc4ace33cf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View File

@ -59,7 +59,7 @@ fn associated_type_bounds<'tcx>(
/// impl trait it isn't possible to write a suitable predicate on the
/// containing function and for type-alias impl trait we don't have a backwards
/// compatibility issue.
#[instrument(level = "trace", skip(tcx), ret)]
#[instrument(level = "trace", skip(tcx, item_ty))]
fn opaque_type_bounds<'tcx>(
tcx: TyCtxt<'tcx>,
opaque_def_id: LocalDefId,

View File

@ -620,7 +620,9 @@ macro_rules! define_queries {
tcx,
{
let ret = call_provider!([$($modifiers)*][tcx, $name, key]);
tracing::trace!(?ret);
rustc_middle::ty::print::with_reduced_queries!({
tracing::trace!(?ret);
});
ret
}
)