-
Notifications
You must be signed in to change notification settings - Fork 741
Move self
into ir::BindgenContext::gen
#1079
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
`parse_one` was never supposed to be public and it uses a bunch of non-public types as a parameters, so downstream crates wouldn't be able to call it anyways.
src/ir/context.rs
Outdated
self.in_codegen = false; | ||
ret | ||
let ret = cb(&self); | ||
(ret, self.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 dont think I've grasped all the idioms of Rust, but still, this seems quite unusual to me. Maybe it would be better to just use (ret, self.options)
?
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.
Ah! This is from when I was trying to do the conversion inside codegen
rather than here, and privacy wouldn't have allowed that. Good eye!
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.
one question, otherwise 🤘
`bindgen` follows a pipeline architecture, and we only ever generate bindings once. By taking ownership of `self`, we can enforce this. We can also remove checks inside `gen` for whether we have resolved type refs or not, since we now know that we haven't because it is guaranteed to only be called the one time.
6db2c60
to
6f401c5
Compare
@bors-servo r=pepyakin |
📌 Commit 6f401c5 has been approved by |
Move `self` into `ir::BindgenContext::gen` Small clean up. See each commit for details. r? @pepyakin
☀️ Test successful - status-travis |
Small clean up. See each commit for details.
r? @pepyakin