From e0712c898e8e180a1a3e1d3497a33078197a64d4 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Fri, 12 Jul 2019 06:31:42 -0400 Subject: [PATCH] useful debug --- src/librustc_typeck/astconv.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/librustc_typeck/astconv.rs b/src/librustc_typeck/astconv.rs index 7d275e48a294a..25e9355161bcf 100644 --- a/src/librustc_typeck/astconv.rs +++ b/src/librustc_typeck/astconv.rs @@ -1496,7 +1496,17 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o { { let tcx = self.tcx(); + debug!( + "find_bound_for_assoc_item(ty_param_def_id={:?}, assoc_name={:?}, span={:?})", + ty_param_def_id, + assoc_name, + span, + ); + let predicates = &self.get_type_parameter_bounds(span, ty_param_def_id).predicates; + + debug!("find_bound_for_assoc_item: predicates={:#?}", predicates); + let bounds = predicates.iter().filter_map(|(p, _)| p.to_opt_poly_trait_ref()); // Check that there is exactly one way to find an associated type with the @@ -1535,7 +1545,11 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o { } }; + debug!("one_bound_for_assoc_type: bound = {:?}", bound); + if let Some(bound2) = bounds.next() { + debug!("one_bound_for_assoc_type: bound2 = {:?}", bound2); + let bounds = iter::once(bound).chain(iter::once(bound2)).chain(bounds); let mut err = struct_span_err!( self.tcx().sess, span, E0221,