-
Notifications
You must be signed in to change notification settings - Fork 747
Multiple cleanups and fix for #355 #357
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
Confirm that this fixes the problem I reported in #355 in the full source. |
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.
r=me thanks!
Will let you delegate to bors so you can decide whether to change the panic message...
return self.codegen(ctx, result, _whitelisted_items, item); | ||
}, | ||
_ => panic!("How?") | ||
_ => panic!("How did this end up here {:?}?", signature) |
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.
Soft preference for a more descriptive message here:
Signature's kind is not TypeKind::Function?! {:?}
// Assume signedness since the default type by the C standard is an int. | ||
let is_signed = repr | ||
.and_then(|r| ctx.resolve_type(r).safe_canonical_type(ctx)) | ||
.map_or(true, |ty| { |
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.
So much nicer :)
/// If this type has a known size, return it (in bytes). This is to | ||
/// alleviate libclang sometimes not giving us a layout (like in the case | ||
/// when an enum is defined inside a class with template parameters). | ||
pub fn known_size(&self) -> Option<usize> { |
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.
Great :)
Updated the error message. @bors-servo r=fitzgen |
📌 Commit 1ad2821 has been approved by |
☀️ Test successful - status-travis |
Fixes #355
Also improves the output of #354.
r? @fitzgen