Skip to content

Commit bb6b433

Browse files
committed
Add debug statements.
1 parent 364bf39 commit bb6b433

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

compiler/rustc_trait_selection/src/traits/util.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,14 @@ impl<'tcx> TraitAliasExpander<'tcx> {
118118

119119
// Get components of trait alias.
120120
let predicates = tcx.super_predicates_of(trait_ref.def_id());
121+
debug!(?predicates);
121122

122123
let items = predicates.predicates.iter().rev().filter_map(|(pred, span)| {
123124
pred.subst_supertrait(tcx, &trait_ref)
124125
.to_opt_poly_trait_pred()
125126
.map(|trait_ref| item.clone_and_push(trait_ref.map_bound(|t| t.trait_ref), *span))
126127
});
127-
debug!("expand_trait_aliases: items={:?}", items.clone());
128+
debug!("expand_trait_aliases: items={:?}", items.clone().collect::<Vec<_>>());
128129

129130
self.stack.extend(items);
130131

compiler/rustc_typeck/src/astconv/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,6 +1070,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
10701070
let mut bounds = Bounds::default();
10711071

10721072
self.add_bounds(param_ty, ast_bounds.iter(), &mut bounds, ty::List::empty());
1073+
debug!(?bounds);
10731074

10741075
bounds
10751076
}

compiler/rustc_typeck/src/collect.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ use std::iter;
5252
mod item_bounds;
5353
mod type_of;
5454

55+
#[derive(Debug)]
5556
struct OnlySelfBounds(bool);
5657

5758
///////////////////////////////////////////////////////////////////////////
@@ -650,6 +651,7 @@ impl<'tcx> ItemCtxt<'tcx> {
650651
/// AST. We do this to avoid having to convert *all* the bounds, which
651652
/// would create artificial cycles. Instead, we can only convert the
652653
/// bounds for a type parameter `X` if `X::Foo` is used.
654+
#[instrument(level = "trace", skip(self, ast_generics))]
653655
fn type_parameter_bounds_in_generics(
654656
&self,
655657
ast_generics: &'tcx hir::Generics<'tcx>,
@@ -659,6 +661,7 @@ impl<'tcx> ItemCtxt<'tcx> {
659661
assoc_name: Option<Ident>,
660662
) -> Vec<(ty::Predicate<'tcx>, Span)> {
661663
let param_def_id = self.tcx.hir().local_def_id(param_id).to_def_id();
664+
debug!(?param_def_id);
662665
ast_generics
663666
.predicates
664667
.iter()
@@ -1140,6 +1143,7 @@ fn super_predicates_that_define_assoc_type(
11401143

11411144
// Combine the two lists to form the complete set of superbounds:
11421145
let superbounds = &*tcx.arena.alloc_from_iter(superbounds1.into_iter().chain(superbounds2));
1146+
debug!(?superbounds);
11431147

11441148
// Now require that immediate supertraits are converted,
11451149
// which will, in turn, reach indirect supertraits.

0 commit comments

Comments
 (0)