about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2020-11-18 09:03:51 -0800
committerEsteban Küber <esteban@kuber.com.ar>2020-11-18 09:06:18 -0800
commitc12e77baddd13843c7bef88bb048d61832eaa053 (patch)
tree7445a9905ce8cb147115ac4cc778746a7caf6d06
parent352796402f8a4b66536693219b65b56bcc14d3ee (diff)
downloadrust-c12e77baddd13843c7bef88bb048d61832eaa053.tar.gz
rust-c12e77baddd13843c7bef88bb048d61832eaa053.zip
review comment
-rw-r--r--compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs
index 51c3ff61dd3..095483aa5a2 100644
--- a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs
+++ b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs
@@ -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 {
@@ -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 `{}`",