@@ -509,11 +509,10 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: DefId) -> Ty<'_> {
509
509
}
510
510
}
511
511
512
+ #[ instrument( skip( tcx) , level = "debug" ) ]
512
513
fn find_opaque_ty_constraints ( tcx : TyCtxt < ' _ > , def_id : LocalDefId ) -> Ty < ' _ > {
513
514
use rustc_hir:: { Expr , ImplItem , Item , TraitItem } ;
514
515
515
- debug ! ( "find_opaque_ty_constraints({:?})" , def_id) ;
516
-
517
516
struct ConstraintLocator < ' tcx > {
518
517
tcx : TyCtxt < ' tcx > ,
519
518
def_id : DefId ,
@@ -522,13 +521,11 @@ fn find_opaque_ty_constraints(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Ty<'_> {
522
521
}
523
522
524
523
impl ConstraintLocator < ' _ > {
524
+ #[ instrument( skip( self ) , level = "debug" ) ]
525
525
fn check ( & mut self , def_id : LocalDefId ) {
526
526
// Don't try to check items that cannot possibly constrain the type.
527
527
if !self . tcx . has_typeck_results ( def_id) {
528
- debug ! (
529
- "find_opaque_ty_constraints: no constraint for `{:?}` at `{:?}`: no typeck results" ,
530
- self . def_id, def_id,
531
- ) ;
528
+ debug ! ( "no constraint: no typeck results" ) ;
532
529
return ;
533
530
}
534
531
// Calling `mir_borrowck` can lead to cycle errors through
@@ -540,10 +537,7 @@ fn find_opaque_ty_constraints(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Ty<'_> {
540
537
. get_by ( |( key, _) | key. def_id == self . def_id )
541
538
. is_none ( )
542
539
{
543
- debug ! (
544
- "find_opaque_ty_constraints: no constraint for `{:?}` at `{:?}`" ,
545
- self . def_id, def_id,
546
- ) ;
540
+ debug ! ( "no constraints in typeck results" ) ;
547
541
return ;
548
542
}
549
543
// Use borrowck to get the type with unerased regions.
@@ -603,7 +597,7 @@ fn find_opaque_ty_constraints(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Ty<'_> {
603
597
604
598
if let Some ( ( prev_span, prev_ty) ) = self . found {
605
599
if * concrete_type != prev_ty {
606
- debug ! ( "find_opaque_ty_constraints: span={:?}" , span) ;
600
+ debug ! ( ? span) ;
607
601
// Found different concrete types for the opaque type.
608
602
let mut err = self . tcx . sess . struct_span_err (
609
603
span,
0 commit comments