Skip to content

Add check to ensure trait bounds are only placed on ty_param #20623

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Jan 7, 2015

Conversation

jroesch
Copy link
Member

@jroesch jroesch commented Jan 6, 2015

This closes #20019, and should reject any where clauses placed on types not involving type parameters.

r? @nikomatsakis

@jroesch
Copy link
Member Author

jroesch commented Jan 6, 2015

This needs one slight fix, I realized I omitted another code path.

@jroesch jroesch force-pushed the reject-non-param-bounds branch 2 times, most recently from 355a1bc to 9d56bcc Compare January 6, 2015 11:54
Add check to ensure trait bounds are only placed on
ty_param
@jroesch jroesch force-pushed the reject-non-param-bounds branch from 9d56bcc to b683e87 Compare January 6, 2015 11:55
@jroesch
Copy link
Member Author

jroesch commented Jan 6, 2015

Waiting to ensure the error messages line up with the test run, but otherwise should be good to look over. @nikomatsakis

@nikomatsakis
Copy link
Contributor

So I'm giving this r+ though I think we should check the TypeOutlives predicates as well (and let me know about the predicates on trait/type-definitions). If you are able to revise it, that's great, if not, it can land in a follow-up. I'd really like to at least establish the precedent that these are not allowed, even if we don't detect every single case just yet.

@nikomatsakis
Copy link
Contributor

p=1 --> should land for alpha, not super critical

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Jan 7, 2015
This closes rust-lang#20019, and should reject any where clauses placed on types not involving type parameters.

r? @nikomatsakis
@alexcrichton alexcrichton merged commit b683e87 into rust-lang:master Jan 7, 2015
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Where clauses that do not involve parameter types should be rejected
3 participants