Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upTest that Servo_* functions have the right signatures #13620
Conversation
highfive
commented
Oct 6, 2016
|
Heads up! This PR modifies the following files:
|
highfive
commented
Oct 6, 2016
| @@ -34,4 +34,4 @@ else | |||
| LIBCLANG_PATH="$(brew --prefix llvm38)/lib/llvm-3.8/lib" | |||
| fi | |||
|
|
|||
| "./${TOOLS_DIR}/regen.py" --target all "${@}" | |||
| "./${TOOLS_DIR}/regen.py" --target bindings "${@}" | |||
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Manishearth
Oct 6, 2016
Author
Member
Oh, that was a mistake. I do this locally since regen.py doesn't set up the env vars.
|
|
||
| with open(GLUE_FILE, "r") as glue, open(GLUE_OUTPUT_FILE, "w+") as glue_output: | ||
| for line in glue: | ||
| glue_output.write(line.replace("pub extern \"C\" fn", "pub unsafe extern \"C\" fn")) |
This comment has been minimized.
This comment has been minimized.
emilio
Oct 6, 2016
Member
So to make clear I've understood this right, the alternative to this hacky script is marking the functions as actually unsafe, right? It seems to me that we might as well do that and, if we care about the loss of compiler diagnostics, move the implementation to a safe function?
This comment has been minimized.
This comment has been minimized.
Manishearth
Oct 6, 2016
Author
Member
We could, I guess. Gets a bit cumbersome and in that case the macro-based solution is better. I prefer the hacky script to making it harder to write glue code. I will in the meantime try to get some coercions into rustc.
3335857
to
2930bd0
|
Addressed |
|
@bors-servo r=emilio |
|
|
|
So, I've just discussed with @Manishearth over IRC. I'm really not too fond in this approach and would prefer converting all the extern functions in In any case, I guess this is fine to land as-is. |
Test that Servo_* functions have the right signatures Fixes #12992 Needs #13617 Not very happy with this solution (and perhaps it should be done in pure Rust, though that can be split out as another easy bug). But it works. The bindings changes are from running a regen on [bug 1308234](https://bugzilla.mozilla.org/show_bug.cgi?id=1308234) r? @emilio <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13620) <!-- Reviewable:end -->
|
|
Manishearth commentedOct 6, 2016
•
edited by larsbergstrom
Fixes #12992
Needs #13617
Not very happy with this solution (and perhaps it should be done in pure Rust, though that can be split out as another easy bug).
But it works. The bindings changes are from running a regen on bug 1308234
r? @emilio
This change is