Skip to content
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

Merged
merged 1 commit into from
Jan 23, 2016

Conversation

bluss
Copy link
Member

@bluss bluss commented Jan 18, 2016

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.

@bluss
Copy link
Member Author

bluss commented Jan 18, 2016

r? @nikomatsakis

@rust-highfive rust-highfive assigned nikomatsakis and unassigned brson Jan 18, 2016
@rust-highfive
Copy link
Collaborator

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`"));
Copy link
Contributor

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.
@bluss bluss changed the title Fix type parameter default error to mention trait definitions Fix type parameter default error to mention type and trait definitions Jan 19, 2016
@bluss
Copy link
Member Author

bluss commented Jan 19, 2016

Good idea, I've updated it to say exactly that.

@nikomatsakis
Copy link
Contributor

@bors r+

thanks @bluss

@bors
Copy link
Contributor

bors commented Jan 19, 2016

📌 Commit 9d77694 has been approved by nikomatsakis

@nikomatsakis
Copy link
Contributor

@bors rollup

@bors
Copy link
Contributor

bors commented Jan 23, 2016

⌛ Testing commit 9d77694 with merge b78b9ae...

bors added a commit that referenced this pull request Jan 23, 2016
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.
steveklabnik added a commit to steveklabnik/rust that referenced this pull request Jan 23, 2016
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.
steveklabnik added a commit to steveklabnik/rust that referenced this pull request Jan 23, 2016
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.
bors added a commit that referenced this pull request Jan 23, 2016
@bors bors merged commit 9d77694 into rust-lang:master Jan 23, 2016
@bluss bluss deleted the trait-default branch January 23, 2016 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants