-
Notifications
You must be signed in to change notification settings - Fork 182
refactored binders to have a private value field #384
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
Conversation
| let interner = self.db.interner(); | ||
|
|
||
| let (lhs_binders, lhs_bound) = lhs.binders.as_ref().into(); | ||
| let (rhs_binders, rhs_bound) = rhs.binders.as_ref().into(); |
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.
This is slightly misleading, because as_ref is cloning the binders, whereas it wasn't before.
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.
binders are cloned later anyway, but I agree, as_ref is kind of a bad name (I just copied it from rustc), should I change it?
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.
Oh, you mean the names, hmm, ok
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 think as_ref is fine. Just be sure the doc comments are clear. (The binders will almost certainly end up being an interned type instead of a vec anyways, so the clone should be cheap).
jackh726
left a comment
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.
Overall, I think this makes things more clean. Couple comments.
| let interner = self.db.interner(); | ||
|
|
||
| let (lhs_binders, lhs_bound) = lhs.binders.as_ref().into(); | ||
| let (rhs_binders, rhs_bound) = rhs.binders.as_ref().into(); |
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 think as_ref is fine. Just be sure the doc comments are clear. (The binders will almost certainly end up being an interned type instead of a vec anyways, so the clone should be cheap).
| pub fn bounds_on_self(&self, interner: &I) -> Vec<QuantifiedWhereClause<I>> { | ||
| let Binders { binders, value } = &self.binders; | ||
|
|
||
| let (binders, assoc_ty_datum) = self.binders.as_ref().into(); |
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.
This does technically add a clone to binders. But I don't think it matters.
Closes #375