Closed
Bug 1354950
Opened 8 years ago
Closed 8 years ago
Add #[destructor_safe] attributes on functions that need it
Categories
(Core :: Graphics: WebRender, enhancement, P3)
Tracking
()
RESOLVED
FIXED
mozilla55
Tracking | Status | |
---|---|---|
firefox55 | --- | fixed |
People
(Reporter: kats, Assigned: kats)
References
Details
(Whiteboard: [gfx-noted])
Attachments
(1 file, 1 obsolete file)
The FFI binding generator has support for recognizing the #[destructor_safe] attribute on rust functions, and using [1] instead of [2] in the generated header. However we need to actually add these attributes to bindings.rs. I have a patch locally to do this.
[1] http://searchfox.org/mozilla-central/rev/eace920a0372051a11d8d275bd9b8f14f3024ecd/gfx/webrender_bindings/webrender_ffi.h#471
[2] http://searchfox.org/mozilla-central/rev/eace920a0372051a11d8d275bd9b8f14f3024ecd/gfx/webrender_bindings/webrender_ffi.h#470
Assignee | ||
Comment 1•8 years ago
|
||
Assignee | ||
Updated•8 years ago
|
Attachment #8856293 -
Flags: review?(rhunt)
Comment 2•8 years ago
|
||
Comment on attachment 8856293 [details] [diff] [review]
Patch
Didn't know about #![feature(custom_attribute)], that's cool.
Attachment #8856293 -
Flags: review?(rhunt) → review+
Assignee | ||
Comment 3•8 years ago
|
||
Turns out it can't be used on the release version of rust :(
https://treeherder.mozilla.org/#/jobs?repo=try&revision=6bdcc7659a1a9edc4350cd271c1631ded0a3be5c
Comment 4•8 years ago
|
||
Hm, that's unfortunate. Another possibility would be to use doc comments [1][2] with a special identifier. Or hardcode a list that we pass to the binding generator.
[1] https://doc.rust-lang.org/book/documentation.html#doc-attributes
[2] https://dtolnay.github.io/syn/syn/struct.Attribute.html
Assignee | ||
Comment 5•8 years ago
|
||
Using a doc comment works great, thanks for the tip!
Try push that includes the updated patch: https://treeherder.mozilla.org/#/jobs?repo=try&revision=3e09ddc847aae07fe343ba03ebc55afe7b00da77
Comment hidden (mozreview-request) |
Assignee | ||
Updated•8 years ago
|
Attachment #8856293 -
Attachment is obsolete: true
Updated•8 years ago
|
Attachment #8857214 -
Flags: review?(rhunt) → review+
Pushed by kgupta@mozilla.com:
https://hg.mozilla.org/projects/graphics/rev/14070c4d46fd
Add a destructor_safe doc attribute as a hint to the binding generator. r=rhunt
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 8•8 years ago
|
||
bugherder |
Assignee | ||
Updated•8 years ago
|
status-firefox55:
--- → fixed
Target Milestone: --- → mozilla55
You need to log in
before you can comment on or make changes to this bug.
Description
•