Add debug statements.
This commit is contained in:
parent
364bf39e31
commit
bb6b433958
3 changed files with 7 additions and 1 deletions
|
@ -118,13 +118,14 @@ impl<'tcx> TraitAliasExpander<'tcx> {
|
||||||
|
|
||||||
// Get components of trait alias.
|
// Get components of trait alias.
|
||||||
let predicates = tcx.super_predicates_of(trait_ref.def_id());
|
let predicates = tcx.super_predicates_of(trait_ref.def_id());
|
||||||
|
debug!(?predicates);
|
||||||
|
|
||||||
let items = predicates.predicates.iter().rev().filter_map(|(pred, span)| {
|
let items = predicates.predicates.iter().rev().filter_map(|(pred, span)| {
|
||||||
pred.subst_supertrait(tcx, &trait_ref)
|
pred.subst_supertrait(tcx, &trait_ref)
|
||||||
.to_opt_poly_trait_pred()
|
.to_opt_poly_trait_pred()
|
||||||
.map(|trait_ref| item.clone_and_push(trait_ref.map_bound(|t| t.trait_ref), *span))
|
.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);
|
self.stack.extend(items);
|
||||||
|
|
||||||
|
|
|
@ -1070,6 +1070,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
|
||||||
let mut bounds = Bounds::default();
|
let mut bounds = Bounds::default();
|
||||||
|
|
||||||
self.add_bounds(param_ty, ast_bounds.iter(), &mut bounds, ty::List::empty());
|
self.add_bounds(param_ty, ast_bounds.iter(), &mut bounds, ty::List::empty());
|
||||||
|
debug!(?bounds);
|
||||||
|
|
||||||
bounds
|
bounds
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,6 +52,7 @@ use std::iter;
|
||||||
mod item_bounds;
|
mod item_bounds;
|
||||||
mod type_of;
|
mod type_of;
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
struct OnlySelfBounds(bool);
|
struct OnlySelfBounds(bool);
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -650,6 +651,7 @@ impl<'tcx> ItemCtxt<'tcx> {
|
||||||
/// AST. We do this to avoid having to convert *all* the bounds, which
|
/// AST. We do this to avoid having to convert *all* the bounds, which
|
||||||
/// would create artificial cycles. Instead, we can only convert the
|
/// would create artificial cycles. Instead, we can only convert the
|
||||||
/// bounds for a type parameter `X` if `X::Foo` is used.
|
/// bounds for a type parameter `X` if `X::Foo` is used.
|
||||||
|
#[instrument(level = "trace", skip(self, ast_generics))]
|
||||||
fn type_parameter_bounds_in_generics(
|
fn type_parameter_bounds_in_generics(
|
||||||
&self,
|
&self,
|
||||||
ast_generics: &'tcx hir::Generics<'tcx>,
|
ast_generics: &'tcx hir::Generics<'tcx>,
|
||||||
|
@ -659,6 +661,7 @@ impl<'tcx> ItemCtxt<'tcx> {
|
||||||
assoc_name: Option<Ident>,
|
assoc_name: Option<Ident>,
|
||||||
) -> Vec<(ty::Predicate<'tcx>, Span)> {
|
) -> Vec<(ty::Predicate<'tcx>, Span)> {
|
||||||
let param_def_id = self.tcx.hir().local_def_id(param_id).to_def_id();
|
let param_def_id = self.tcx.hir().local_def_id(param_id).to_def_id();
|
||||||
|
debug!(?param_def_id);
|
||||||
ast_generics
|
ast_generics
|
||||||
.predicates
|
.predicates
|
||||||
.iter()
|
.iter()
|
||||||
|
@ -1140,6 +1143,7 @@ fn super_predicates_that_define_assoc_type(
|
||||||
|
|
||||||
// Combine the two lists to form the complete set of superbounds:
|
// Combine the two lists to form the complete set of superbounds:
|
||||||
let superbounds = &*tcx.arena.alloc_from_iter(superbounds1.into_iter().chain(superbounds2));
|
let superbounds = &*tcx.arena.alloc_from_iter(superbounds1.into_iter().chain(superbounds2));
|
||||||
|
debug!(?superbounds);
|
||||||
|
|
||||||
// Now require that immediate supertraits are converted,
|
// Now require that immediate supertraits are converted,
|
||||||
// which will, in turn, reach indirect supertraits.
|
// which will, in turn, reach indirect supertraits.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue