File tree 1 file changed +3
-3
lines changed
compiler/rustc_middle/src/ty
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -204,7 +204,7 @@ pub fn suggest_constraining_type_param(
204
204
// - insert: `, T: Zar`
205
205
//
206
206
// 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:
208
208
//
209
209
// Message:
210
210
// trait Foo<T=()> {... }
@@ -217,8 +217,8 @@ pub fn suggest_constraining_type_param(
217
217
if matches ! ( param. kind, hir:: GenericParamKind :: Type { default : Some ( _) , .. } )
218
218
&& generics. where_clause . predicates . len ( ) == 0
219
219
{
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` .
222
222
err. span_suggestion_verbose (
223
223
generics. where_clause . tail_span_for_suggestion ( ) ,
224
224
& msg_restrict_type_further,
You can’t perform that action at this time.
0 commit comments