-
Notifications
You must be signed in to change notification settings - Fork 742
Constant variable improvements. #260
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
@emilio CI is failing, going to hold off on reviewing this until you fix it. Ping me when its ready :) |
☔ The latest upstream changes (presumably #263) made this pull request unmergeable. Please resolve the merge conflicts. |
☔ The latest upstream changes (presumably #261) made this pull request unmergeable. Please resolve the merge conflicts. |
dfc1141
to
fe26aea
Compare
This should be ready for review @fitzgen |
ea35be8
to
1536cf7
Compare
☔ The latest upstream changes (presumably #266) made this pull request unmergeable. Please resolve the merge conflicts. |
Ok, CI is green after removing nightly builds. |
This includes the fix for #271, given without the changes in this PR to the test suite adding new tests correctly is a pain. |
…o USR. Apparently MSVC isn't that good at giving us USRs... Fixes rust-lang#271
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.
LGTM, thanks for breaking this up into nice little commits :)
let _ = writeln!(dst, "test_header!(header_{}, {:?});", | ||
func, entry.path()); | ||
writeln!(dst, "test_header!(header_{}, {:?});", | ||
func, entry.path()).unwrap(); |
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.
Did you rustfmt this? I'd think it would put each parameter on its own line if they are too long to fit on one line.
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 didn't because cargo fmt
doesn't detect the build.rs file apparently. Probably worth making it recognise it as a followup.
/// Create a dummy EvalResult. | ||
pub fn new(_: Cursor) -> Self { | ||
EvalResult { | ||
x: ::std::ptr::null_mut(), |
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.
use std::ptr
at the top?
} | ||
Err(..) => { | ||
const_item | ||
.build(helpers::ast_ty::byte_array_expr(bytes)) |
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 wonder if we should always make C strings a byte array...
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's just because the bytestring reads better, but should be effectively equivalent.
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's just because the bytestring reads better, but should be effectively equivalent
actually bindgen generates i8 byte arrays for literal strings in processor definitions. u8 arrays would IMHO be a more useful resp. *const c_char compatible representation.
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.
Could you file an issue with a test-case? Thanks!
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.
Could you file an issue with a test-case? Thanks!
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 wrote an issue ticket in the meanwhile: #1401
but i think it's more an issue, which rather needs contemplation than any example, where it leads to unpleasant results.
@@ -123,6 +123,14 @@ impl Type { | |||
Self::new(Some(name), None, kind, false) | |||
} | |||
|
|||
/// Is this an floating point type? |
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.
"an" -> "a"
c_str.to_string_lossy().into_owned() | ||
let ret = c_str.to_string_lossy().into_owned(); | ||
clang_disposeString(self); | ||
ret |
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.
... lol ...
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's not a big deal because they're refcounted, but still...
@bors-servo r=fitzgen Thanks for the review Nick, and sorry for this patch pile :/ |
📌 Commit 19d36d4 has been approved by |
☀️ Test successful - status-travis |
Fixes #256.
r? @fitzgen