Skip to content

Commit 95f296d

Browse files
committed
Debug log all the things
1 parent 692f638 commit 95f296d

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

compiler/rustc_typeck/src/collect/type_of.rs

+5-11
Original file line numberDiff line numberDiff line change
@@ -509,11 +509,10 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: DefId) -> Ty<'_> {
509509
}
510510
}
511511

512+
#[instrument(skip(tcx), level = "debug")]
512513
fn find_opaque_ty_constraints(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Ty<'_> {
513514
use rustc_hir::{Expr, ImplItem, Item, TraitItem};
514515

515-
debug!("find_opaque_ty_constraints({:?})", def_id);
516-
517516
struct ConstraintLocator<'tcx> {
518517
tcx: TyCtxt<'tcx>,
519518
def_id: DefId,
@@ -522,13 +521,11 @@ fn find_opaque_ty_constraints(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Ty<'_> {
522521
}
523522

524523
impl ConstraintLocator<'_> {
524+
#[instrument(skip(self), level = "debug")]
525525
fn check(&mut self, def_id: LocalDefId) {
526526
// Don't try to check items that cannot possibly constrain the type.
527527
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");
532529
return;
533530
}
534531
// Calling `mir_borrowck` can lead to cycle errors through
@@ -540,10 +537,7 @@ fn find_opaque_ty_constraints(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Ty<'_> {
540537
.get_by(|(key, _)| key.def_id == self.def_id)
541538
.is_none()
542539
{
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");
547541
return;
548542
}
549543
// Use borrowck to get the type with unerased regions.
@@ -603,7 +597,7 @@ fn find_opaque_ty_constraints(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Ty<'_> {
603597

604598
if let Some((prev_span, prev_ty)) = self.found {
605599
if *concrete_type != prev_ty {
606-
debug!("find_opaque_ty_constraints: span={:?}", span);
600+
debug!(?span);
607601
// Found different concrete types for the opaque type.
608602
let mut err = self.tcx.sess.struct_span_err(
609603
span,

0 commit comments

Comments
 (0)