// Get components of trait alias.
let predicates = tcx.super_predicates_of(trait_ref.def_id());
+ debug!(?predicates);
let items = predicates.predicates.iter().rev().filter_map(|(pred, span)| {
pred.subst_supertrait(tcx, &trait_ref)
.to_opt_poly_trait_pred()
.map(|trait_ref| item.clone_and_push(trait_ref.map_bound(|t| t.trait_ref), *span))
});
- debug!("expand_trait_aliases: items={:?}", items.clone());
+ debug!("expand_trait_aliases: items={:?}", items.clone().collect::<Vec<_>>());
self.stack.extend(items);
mod item_bounds;
mod type_of;
+#[derive(Debug)]
struct OnlySelfBounds(bool);
///////////////////////////////////////////////////////////////////////////
/// AST. We do this to avoid having to convert *all* the bounds, which
/// would create artificial cycles. Instead, we can only convert the
/// bounds for a type parameter `X` if `X::Foo` is used.
+ #[instrument(level = "trace", skip(self, ast_generics))]
fn type_parameter_bounds_in_generics(
&self,
ast_generics: &'tcx hir::Generics<'tcx>,
assoc_name: Option<Ident>,
) -> Vec<(ty::Predicate<'tcx>, Span)> {
let param_def_id = self.tcx.hir().local_def_id(param_id).to_def_id();
+ debug!(?param_def_id);
ast_generics
.predicates
.iter()
// Combine the two lists to form the complete set of superbounds:
let superbounds = &*tcx.arena.alloc_from_iter(superbounds1.into_iter().chain(superbounds2));
+ debug!(?superbounds);
// Now require that immediate supertraits are converted,
// which will, in turn, reach indirect supertraits.