Skip to content

Refactor compare_impl_method to use all bounds #20290

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

Merged
merged 1 commit into from
Jan 15, 2015

Conversation

jroesch
Copy link
Member

@jroesch jroesch commented Dec 29, 2014

This should fix both #20020 and #20107. This moves out the code into its own file.

I have a couple concerns that can either be addressed in this PR or in a future one.

  • The error reporting for the fulfillment context should be span aware because currently it is attached to the top
    of the file which is less then desirable.
  • There is a failure in the test file: run-pass/issue-2611-3.rs, this seems like it should be a failure to me, but I am not sure.

As a nit I'm not enthused about the file name, and am open to better suggestions.

r? @nikomatsakis

@jroesch jroesch force-pushed the generalize-impl-bounds branch 4 times, most recently from 4dfaccf to 5a2568b Compare January 2, 2015 20:21
);

// Construct trait parameter environment and then shift it into the skolemized viewpoint.
let mut trait_param_env =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you probably want impl_env cloned and using hybrid_preds, rather than starting with the trait environment. Not that it really matters. But nonetheless, it seems more correct: we've brought everything into the impl namespace, so those are the type parameters etc that are in scope.

@jroesch jroesch force-pushed the generalize-impl-bounds branch 2 times, most recently from 098990d to 03d7e42 Compare January 3, 2015 00:49
@nikomatsakis
Copy link
Contributor

We should definitely get the spans cleaned up before we land this. I can help you with that.

@jroesch jroesch force-pushed the generalize-impl-bounds branch 4 times, most recently from 45a8708 to 574d824 Compare January 6, 2015 09:58
@jroesch
Copy link
Member Author

jroesch commented Jan 10, 2015

This is waiting on #20789 and a rebase before it is ready to merged.

@nikomatsakis
Copy link
Contributor

@jroesch so #20789 landed.

@jroesch jroesch force-pushed the generalize-impl-bounds branch 3 times, most recently from b175240 to fe65af0 Compare January 14, 2015 21:42
Refactor compare_impl_method into its own file. Modify the
code to stop comparing individual parameter bounds.
Instead we now use the predicates list attached to the trait
and implementation generics. This ensures consistency even
when bounds are declared in different places (i.e on
a parameter vs. in a where clause).
@jroesch jroesch force-pushed the generalize-impl-bounds branch from fe65af0 to 6a66b32 Compare January 14, 2015 21:43
bors added a commit that referenced this pull request Jan 15, 2015
…sakis

This should fix both #20020 and #20107. This moves out the code into its own file.

I have a couple concerns that can either be addressed in this PR or in a future one.

- The error reporting for the fulfillment context should be span aware because currently it is attached to the top
  of the file which is less then desirable.
- There is a failure in the test file: run-pass/issue-2611-3.rs, this seems like it should be a failure to me, but I am not sure.

As a nit I'm not enthused about the file name, and am open to better suggestions. 

r? @nikomatsakis
@bors bors merged commit 6a66b32 into rust-lang:master Jan 15, 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.

3 participants