Skip to content

Commit

Permalink
change how TyAnon prints in verbose mode
Browse files Browse the repository at this point in the history
Otherwise we get too many cycles. We really have to make `{:?}` do no
queries, I think.
  • Loading branch information
nikomatsakis committed Sep 12, 2017
1 parent 6cd24a5 commit 2dd5bb2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/librustc/util/ppaux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,10 @@ impl<'tcx> fmt::Display for ty::TypeVariants<'tcx> {
}
TyProjection(ref data) => write!(f, "{}", data),
TyAnon(def_id, substs) => {
if verbose() {
return write!(f, "TyAnon({:?}, {:?})", def_id, substs);
}

ty::tls::with(|tcx| {
// Grab the "TraitA + TraitB" from `impl TraitA + TraitB`,
// by looking up the projections associated with the def_id.
Expand Down

0 comments on commit 2dd5bb2

Please sign in to comment.