-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix type parameter default error to mention type and trait definitions #30997
Conversation
r? @brson (rust_highfive has picked a reviewer for you, use r? to override) |
@@ -1923,7 +1923,7 @@ fn get_or_create_type_parameter_def<'a,'tcx>(ccx: &CrateCtxt<'a,'tcx>, | |||
param.id, | |||
param.span, | |||
format!("defaults for type parameters are only allowed on type definitions, \ | |||
like `struct` or `enum`")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like if we're going to try and be exhaustive, we ought to include type
aliases too. I also think we should add trait
into the list with struct
and enum
, like so: "defaults for type parameters are only allowed in struct
, enum
, type
, or trait
definitions".
Introduced in PR rust-lang#30724, needs to mention that type parameter defaults are legal in trait and type definitions too.
Good idea, I've updated it to say exactly that. |
📌 Commit 9d77694 has been approved by |
@bors rollup |
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.
Fix type parameter default error to mention type and trait definitions Introduced in PR rust-lang#30724, needs to mention that type parameter defaults are legal in trait and type definitions too.
Fix type parameter default error to mention type and trait definitions Introduced in PR rust-lang#30724, needs to mention that type parameter defaults are legal in trait and type definitions too.
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.