Skip to content

Commit 9d77694

Browse files
committed
Fix type parameter default error to mention type and trait definitions
Introduced in PR #30724, needs to mention that type parameter defaults are legal in trait and type definitions too.
1 parent bff5292 commit 9d77694

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/librustc_typeck/collect.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1922,8 +1922,8 @@ fn get_or_create_type_parameter_def<'a,'tcx>(ccx: &CrateCtxt<'a,'tcx>,
19221922
lint::builtin::INVALID_TYPE_PARAM_DEFAULT,
19231923
param.id,
19241924
param.span,
1925-
format!("defaults for type parameters are only allowed on type definitions, \
1926-
like `struct` or `enum`"));
1925+
format!("defaults for type parameters are only allowed in `struct`, \
1926+
`enum`, `type`, or `trait` definitions."));
19271927
}
19281928
}
19291929

0 commit comments

Comments
 (0)