diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2022-05-04 22:46:24 +0200 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2022-05-04 22:46:24 +0200 |
| commit | bb6b433958cf1471f7df02f824a7112c2ef81792 (patch) | |
| tree | eafaca02cccbd26befd46a8fc03c8830315ebb20 | |
| parent | 364bf39e3179e148742466810d0cb9c8ec1c343a (diff) | |
| download | rust-bb6b433958cf1471f7df02f824a7112c2ef81792.tar.gz rust-bb6b433958cf1471f7df02f824a7112c2ef81792.zip | |
Add debug statements.
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/util.rs | 3 | ||||
| -rw-r--r-- | compiler/rustc_typeck/src/astconv/mod.rs | 1 | ||||
| -rw-r--r-- | compiler/rustc_typeck/src/collect.rs | 4 |
3 files changed, 7 insertions, 1 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/util.rs b/compiler/rustc_trait_selection/src/traits/util.rs index 7543d1f9a7b..d101f69096f 100644 --- a/compiler/rustc_trait_selection/src/traits/util.rs +++ b/compiler/rustc_trait_selection/src/traits/util.rs @@ -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); diff --git a/compiler/rustc_typeck/src/astconv/mod.rs b/compiler/rustc_typeck/src/astconv/mod.rs index fd1b7bfa0b1..673a2c2fcaf 100644 --- a/compiler/rustc_typeck/src/astconv/mod.rs +++ b/compiler/rustc_typeck/src/astconv/mod.rs @@ -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 } diff --git a/compiler/rustc_typeck/src/collect.rs b/compiler/rustc_typeck/src/collect.rs index c1c63c46066..7a7e4a2f2b0 100644 --- a/compiler/rustc_typeck/src/collect.rs +++ b/compiler/rustc_typeck/src/collect.rs @@ -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. |
