Skip to content

Replace the define_matrix! macro using a proc macro.#314

Merged
bors-servo merged 11 commits intomasterfrom
proc-macro
Jan 12, 2019
Merged

Replace the define_matrix! macro using a proc macro.#314
bors-servo merged 11 commits intomasterfrom
proc-macro

Conversation

@emilio
Copy link
Copy Markdown
Member

@emilio emilio commented Jan 12, 2019

This will allow cbindgen to parse this without macro expansion, which will allow us to do it much faster, and at build-time.


This change is Reviewable

@emilio
Copy link
Copy Markdown
Member Author

emilio commented Jan 12, 2019

r? @nox / @kvark / @nical

@emilio
Copy link
Copy Markdown
Member Author

emilio commented Jan 12, 2019

@bors-servo r=nox

We could use a #[proc_macro_attribute] to generate the _unit field, but that's unstable in rustc 1.23 which is the current supported version, and it's not that much of a benefit. We could also generate #[repr(C)] but that would confuse cbindgen.

@bors-servo
Copy link
Copy Markdown
Contributor

📌 Commit 9e0f245 has been approved by nox

@bors-servo
Copy link
Copy Markdown
Contributor

⌛ Testing commit 9e0f245 with merge cc2b285...

bors-servo pushed a commit that referenced this pull request Jan 12, 2019
Replace the `define_matrix!` macro using a proc macro.

This will allow `cbindgen` to parse this without macro expansion, which will allow us to do it much faster, and at build-time.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/euclid/314)
<!-- Reviewable:end -->
@bors-servo
Copy link
Copy Markdown
Contributor

☀️ Test successful - checks-travis
Approved by: nox
Pushing cc2b285 to master...

@bors-servo bors-servo merged commit 9e0f245 into master Jan 12, 2019
@emilio emilio deleted the proc-macro branch January 12, 2019 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants