Skip to content

Commit

Permalink
useful debug
Browse files Browse the repository at this point in the history
  • Loading branch information
nikomatsakis authored and Alexander Regueiro committed Aug 5, 2019
1 parent 63a67a0 commit e0712c8
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/librustc_typeck/astconv.rs
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit e0712c8

Please sign in to comment.