-
Notifications
You must be signed in to change notification settings - Fork 183
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
Add implied bounds #56
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a few nits, really just requests for documentation.
src/lower/mod.rs
Outdated
// we generate the following clause: | ||
// | ||
// for<?T> WF(Foo<?T>) :- WF(?T), (?T: Eq), WF(?T: Eq). | ||
macro_rules! well_formed { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to have a comment explaining what this does =)
} | ||
|
||
// Here, we do know that `T: Clone`, so we can. | ||
// Here, we do know that `T: Eq`, so we can. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: T: Eq<T>
} | ||
|
||
impl<T: ExpandWhereClauses> WellFormed for ir::Binders<T> { | ||
fn wf_clauses(&self, wf_predicate: ir::WellFormed, program: &ir::Program) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I definitely prefer this to the macro, but I'd still like some comments. =)
src/lower/mod.rs
Outdated
tys.chain(where_clauses.iter().cloned().casted()).collect() | ||
} | ||
consequence: wf_predicate.clone().cast(), | ||
conditions: where_clauses.iter().cloned().casted().collect(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in particular it's not obvious to me what has changed in this commit other than tests, just looking at the code anyhow
Closing in favor of #82. |
These commits add implied bounds on structs and remove WF conditions for type parameters in WF predicates, e.g. before this PR we had:
and after this PR: