servo: Merge #14710 - Mark DOM interfaces as repr(C) (from nox:repr-c); r=KiChjang
authorAnthony Ramine <n.oxyde@gmail.com>
Sat, 24 Dec 2016 23:26:00 -0800
changeset 340412 cc8dc2adc696a000182bf103323472d2a4415575
parent 340411 198d3fbda074b0b6276099a2857be2b4a43017a2
child 340413 9d69327d6672120207d2136c7da2435858359eed
push id31307
push usergszorc@mozilla.com
push dateSat, 04 Feb 2017 00:59:06 +0000
treeherdermozilla-central@94079d43835f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersKiChjang
servo: Merge #14710 - Mark DOM interfaces as repr(C) (from nox:repr-c); r=KiChjang Source-Repo: https://github.com/servo/servo Source-Revision: b5909f26cf4ca255d13bf31b3261e6c9df11a4a1
servo/components/plugins/jstraceable.rs
--- a/servo/components/plugins/jstraceable.rs
+++ b/servo/components/plugins/jstraceable.rs
@@ -7,16 +7,17 @@ use syntax::codemap::Span;
 use syntax::ext::base::{Annotatable, ExtCtxt};
 use syntax::ptr::P;
 
 pub fn expand_dom_struct(cx: &mut ExtCtxt, sp: Span, _: &MetaItem, anno: Annotatable) -> Annotatable {
     if let Annotatable::Item(item) = anno {
         let mut item2 = (*item).clone();
         item2.attrs.push(quote_attr!(cx, #[must_root]));
         item2.attrs.push(quote_attr!(cx, #[privatize]));
+        item2.attrs.push(quote_attr!(cx, #[repr(C)]));
         item2.attrs.push(quote_attr!(cx, #[derive(JSTraceable)]));
         item2.attrs.push(quote_attr!(cx, #[derive(HeapSizeOf)]));
 
         // The following attributes are only for internal usage
         item2.attrs.push(quote_attr!(cx, #[_generate_reflector]));
         // #[dom_struct] gets consumed, so this lets us keep around a residue
         // Do NOT register a modifier/decorator on this attribute
         item2.attrs.push(quote_attr!(cx, #[_dom_struct_marker]));