Skip to content

Commit 36884fa

Browse files
committed
add additional logging
1 parent fd9c6d6 commit 36884fa

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

compiler/rustc_borrowck/src/region_infer/opaque_types.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use rustc_trait_selection::opaque_types::{
2323
};
2424
use rustc_trait_selection::solve::NoSolution;
2525
use rustc_trait_selection::traits::query::type_op::custom::CustomTypeOp;
26-
use tracing::{debug, instrument};
26+
use tracing::{debug, debug_span, instrument};
2727

2828
use super::reverse_sccs::ReverseSccGraph;
2929
use super::values::RegionValues;
@@ -198,6 +198,8 @@ pub(crate) fn handle_opaque_type_uses<'tcx>(
198198
})
199199
.collect::<Vec<_>>();
200200

201+
debug!(?opaque_types);
202+
201203
collect_defining_uses(
202204
root_cx,
203205
infcx,
@@ -289,6 +291,7 @@ fn apply_member_constraints<'tcx>(
289291
defining_uses: &[DefiningUse<'tcx>],
290292
) {
291293
for DefiningUse { opaque_type_key: _, arg_regions, hidden_type } in defining_uses {
294+
let _span = debug_span!("apply_member_constraints", ?arg_regions, ?hidden_type);
292295
let mut visitor =
293296
ApplyMemberConstraintsVisitor { rcx, arg_regions, span: hidden_type.span, constraints };
294297
hidden_type.ty.visit_with(&mut visitor);
@@ -318,6 +321,7 @@ impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for ApplyMemberConstraintsVisitor<'_, 'tcx>
318321
//
319322
// If there's a unique minimum choice, we emit a `'member: 'min_choice` constraint.
320323
// Note that we do not require the two regions to be equal... TODO examples
324+
#[instrument(level = "debug", skip(self))]
321325
fn visit_region(&mut self, r: Region<'tcx>) {
322326
let member_vid = match r.kind() {
323327
ty::ReBound(..) => return,
@@ -447,6 +451,7 @@ fn map_defining_uses_to_definition_site<'tcx>(
447451
let vid = rcx.representative(r.as_var());
448452
rcx.definitions[vid].external_name.unwrap()
449453
});
454+
let _span = debug_span!("map_defining_uses_to_definition_site", ?opaque_type_key, ?arg_regions, ?hidden_type);
450455
// TODO: explain what's going on here
451456
let mut visitor =
452457
HiddenTypeMeh { rcx, arg_regions, opaque_type_key, hidden_type, deferred_errors };

0 commit comments

Comments
 (0)