Skip to content

Commit e1607c8

Browse files
iximeowestebank
andcommitted
clean up comment text a bit
Co-authored-by: Esteban Küber <[email protected]>
1 parent 0eac38b commit e1607c8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

compiler/rustc_middle/src/ty/diagnostics.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ pub fn suggest_constraining_type_param(
204204
// - insert: `, T: Zar`
205205
//
206206
// Additionally, there may be no `where` clause whatsoever in the case that this was
207-
// reached becauase the generic parameter has a default:
207+
// reached because the generic parameter has a default:
208208
//
209209
// Message:
210210
// trait Foo<T=()> {... }
@@ -217,8 +217,8 @@ pub fn suggest_constraining_type_param(
217217
if matches!(param.kind, hir::GenericParamKind::Type { default: Some(_), .. })
218218
&& generics.where_clause.predicates.len() == 0
219219
{
220-
// Suggest a bound, but there are no existing where clauses for this `<T=Foo>`, so
221-
// suggest adding one.
220+
// Suggest a bound, but there is no existing `where` clause *and* the type param has a
221+
// default (`<T=Foo>`), so we suggest adding `where T: Bar`.
222222
err.span_suggestion_verbose(
223223
generics.where_clause.tail_span_for_suggestion(),
224224
&msg_restrict_type_further,

0 commit comments

Comments
 (0)