File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
compiler/rustc_middle/src/ty Expand file tree Collapse file tree 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(
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,
You can’t perform that action at this time.
0 commit comments