about summary refs log tree commit diff
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2020-09-14 13:13:02 -0700
committeriximeow <me@iximeow.net>2020-09-14 13:13:02 -0700
commite1607c87f0bb96c1c59d84a2789b7f7d2b69e182 (patch)
tree8d245ccdf65d21566fb259302c8192008fd5ac7e
parent0eac38b7a65c29734f4b2d34f35ee0aa9cb00a74 (diff)
downloadrust-e1607c87f0bb96c1c59d84a2789b7f7d2b69e182.tar.gz
rust-e1607c87f0bb96c1c59d84a2789b7f7d2b69e182.zip
clean up comment text a bit
Co-authored-by: Esteban Küber <esteban@kuber.com.ar>
-rw-r--r--compiler/rustc_middle/src/ty/diagnostics.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_middle/src/ty/diagnostics.rs b/compiler/rustc_middle/src/ty/diagnostics.rs
index 0416ef9e643..715319747e3 100644
--- a/compiler/rustc_middle/src/ty/diagnostics.rs
+++ b/compiler/rustc_middle/src/ty/diagnostics.rs
@@ -204,7 +204,7 @@ pub fn suggest_constraining_type_param(
         //                                          - insert: `, T: Zar`
         //
         // Additionally, there may be no `where` clause whatsoever in the case that this was
-        // reached becauase the generic parameter has a default:
+        // reached because the generic parameter has a default:
         //
         //    Message:
         //      trait Foo<T=()> {... }
@@ -217,8 +217,8 @@ pub fn suggest_constraining_type_param(
         if matches!(param.kind, hir::GenericParamKind::Type { default: Some(_), .. })
             && generics.where_clause.predicates.len() == 0
         {
-            // Suggest a bound, but there are no existing where clauses for this `<T=Foo>`, so
-            // suggest adding one.
+            // Suggest a bound, but there is no existing `where` clause *and* the type param has a
+            // default (`<T=Foo>`), so we suggest adding `where T: Bar`.
             err.span_suggestion_verbose(
                 generics.where_clause.tail_span_for_suggestion(),
                 &msg_restrict_type_further,