Skip to content

Commit

Permalink
review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Nov 18, 2020
1 parent 3527964 commit c12e77b
Showing 1 changed file with 1 addition and 3 deletions.
Expand Up @@ -2070,7 +2070,6 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {

let mut parent_predicate = parent_trait_ref.without_const().to_predicate(tcx);
let mut data = data;
let mut redundant = false;
let mut count = 0;
seen_requirements.insert(parent_def_id);
while let ObligationCauseCode::ImplDerivedObligation(child) = &*data.parent_code {
Expand All @@ -2081,12 +2080,11 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
break;
}
count += 1;
redundant = true;
data = child;
parent_predicate = child_trait_ref.without_const().to_predicate(tcx);
parent_trait_ref = child_trait_ref;
}
if redundant {
if count > 0 {
err.note(&format!("{} redundant requirements hidden", count));
err.note(&format!(
"required because of the requirements on the impl of `{}` for `{}`",
Expand Down

0 comments on commit c12e77b

Please sign in to comment.