Skip to content

Commit b78b9ae

Browse files
committed
Auto merge of #30997 - bluss:trait-default, r=nikomatsakis
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.
2 parents 1571c69 + 9d77694 commit b78b9ae

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
@@ -1918,8 +1918,8 @@ fn get_or_create_type_parameter_def<'a,'tcx>(ccx: &CrateCtxt<'a,'tcx>,
19181918
lint::builtin::INVALID_TYPE_PARAM_DEFAULT,
19191919
param.id,
19201920
param.span,
1921-
format!("defaults for type parameters are only allowed on type definitions, \
1922-
like `struct` or `enum`"));
1921+
format!("defaults for type parameters are only allowed in `struct`, \
1922+
`enum`, `type`, or `trait` definitions."));
19231923
}
19241924
}
19251925

0 commit comments

Comments
 (0)