1
Fork 0

Add debug statements.

This commit is contained in:
Camille GILLOT 2022-05-04 22:46:24 +02:00
parent 364bf39e31
commit bb6b433958
3 changed files with 7 additions and 1 deletions

View file

@ -118,13 +118,14 @@ impl<'tcx> TraitAliasExpander<'tcx> {
// 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);

View file

@ -1070,6 +1070,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
let mut bounds = Bounds::default();
self.add_bounds(param_ty, ast_bounds.iter(), &mut bounds, ty::List::empty());
debug!(?bounds);
bounds
}

View file

@ -52,6 +52,7 @@ use std::iter;
mod item_bounds;
mod type_of;
#[derive(Debug)]
struct OnlySelfBounds(bool);
///////////////////////////////////////////////////////////////////////////
@ -650,6 +651,7 @@ impl<'tcx> ItemCtxt<'tcx> {
/// 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>,
@ -659,6 +661,7 @@ impl<'tcx> ItemCtxt<'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()
@ -1140,6 +1143,7 @@ fn super_predicates_that_define_assoc_type(
// 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.