]> git.lizzy.rs Git - rust.git/commitdiff
Add debug statements.
authorCamille GILLOT <gillot.camille@gmail.com>
Wed, 4 May 2022 20:46:24 +0000 (22:46 +0200)
committerCamille GILLOT <gillot.camille@gmail.com>
Wed, 4 May 2022 20:46:24 +0000 (22:46 +0200)
compiler/rustc_trait_selection/src/traits/util.rs
compiler/rustc_typeck/src/astconv/mod.rs
compiler/rustc_typeck/src/collect.rs

index 7543d1f9a7b5532693d13bb990ce17d14618570a..d101f69096fe8e013572d2c605c99dc54a1d938b 100644 (file)
@@ -118,13 +118,14 @@ fn expand(&mut self, item: &TraitAliasExpansionInfo<'tcx>) -> bool {
 
         // 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);
 
index fd1b7bfa0b1b0952cdb6321af62647657c297176..673a2c2fcaf400bfed0d34707aaef0ae55e18179 100644 (file)
@@ -1070,6 +1070,7 @@ fn compute_bounds_inner(
         let mut bounds = Bounds::default();
 
         self.add_bounds(param_ty, ast_bounds.iter(), &mut bounds, ty::List::empty());
+        debug!(?bounds);
 
         bounds
     }
index c1c63c460664cc16eed32f5d518b3e5cbd372517..7a7e4a2f2b02b725c48b08a7a8d053810f222630 100644 (file)
@@ -52,6 +52,7 @@
 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 @@ fn type_parameter_bounds_in_generics(
         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.