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

Handle supertrait calls in default methods #4537

Closed
wants to merge 2 commits into from

Conversation

catamorphism
Copy link
Contributor

r? @graydon Add a new method_super origin for supertrait methods. Also make
coherence create a table that maps pairs of trait IDs and self types
to impl IDs, so that it's possible to check a supertrait method
knowing only its index in its trait's methods (without knowing all
supertraits for a given trait).

As per #3979

@catamorphism
Copy link
Contributor Author

n.b. This only handles supertrait method calls on self; it doesn't handle the case of passing self to a method that expects it to have a supertrait bound. I'll file a separate pull request for the latter case.

Add a new method_super origin for supertrait methods. Also make
coherence create a table that maps pairs of trait IDs and self types
to impl IDs, so that it's possible to check a supertrait method
knowing only its index in its trait's methods (without knowing all
supertraits for a given trait).

As per rust-lang#3979
@graydon
Copy link
Contributor

graydon commented Jan 22, 2013

r+ from a style and direction perspective (and it looks great); unfortunately it also looks Serious enough that I'm not real comfortable pretending to be able to judge semantic correctness. Maybe get someone who knows the numerous related invariants to double-check?

@catamorphism
Copy link
Contributor Author

@nikomatsakis - Can you double-check?

@nikomatsakis
Copy link
Contributor

@catamorphism ok will take a look today

@catamorphism
Copy link
Contributor Author

Merged in 90cee95 -- see #4678 for future work.

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