Skip to content

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

Merged
alexcrichton merged 1 commit into
rust-lang:masterfrom
jroesch:reject-non-param-bounds
Jan 7, 2015
Merged

Add check to ensure trait bounds are only placed on ty_param#20623
alexcrichton merged 1 commit into
rust-lang:masterfrom
jroesch:reject-non-param-bounds

Conversation

@jroesch

@jroesch jroesch commented Jan 6, 2015

Copy link
Copy Markdown
Contributor

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

r? @nikomatsakis

@jroesch

jroesch commented Jan 6, 2015

Copy link
Copy Markdown
Contributor Author

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

jroesch commented Jan 6, 2015

Copy link
Copy Markdown
Contributor Author

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

@nikomatsakis

Copy link
Copy Markdown
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
Copy Markdown
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
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.

Where clauses that do not involve parameter types should be rejected

3 participants