Skip to content

Commit c12e77b

Browse files
committed
review comment
1 parent 3527964 commit c12e77b

File tree

1 file changed

+1
-3
lines changed
  • compiler/rustc_trait_selection/src/traits/error_reporting

1 file changed

+1
-3
lines changed

compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -2070,7 +2070,6 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
20702070

20712071
let mut parent_predicate = parent_trait_ref.without_const().to_predicate(tcx);
20722072
let mut data = data;
2073-
let mut redundant = false;
20742073
let mut count = 0;
20752074
seen_requirements.insert(parent_def_id);
20762075
while let ObligationCauseCode::ImplDerivedObligation(child) = &*data.parent_code {
@@ -2081,12 +2080,11 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
20812080
break;
20822081
}
20832082
count += 1;
2084-
redundant = true;
20852083
data = child;
20862084
parent_predicate = child_trait_ref.without_const().to_predicate(tcx);
20872085
parent_trait_ref = child_trait_ref;
20882086
}
2089-
if redundant {
2087+
if count > 0 {
20902088
err.note(&format!("{} redundant requirements hidden", count));
20912089
err.note(&format!(
20922090
"required because of the requirements on the impl of `{}` for `{}`",

0 commit comments

Comments
 (0)