diff options
author | Emilio Cobos Álvarez <ecoal95@gmail.com> | 2016-04-02 03:52:21 +0200 |
---|---|---|
committer | Emilio Cobos Álvarez <ecoal95@gmail.com> | 2016-04-02 03:52:21 +0200 |
commit | 3fa69fc8d54d60a8f3fdfa17188890f22e573521 (patch) | |
tree | 4fab7d289fe85d4f1e87abe1b69f339c8e03cefd | |
parent | 0aa7464ff605c6b2b6caed780d3bf76e1167aa78 (diff) |
gen: repr(C) opaque types
-rw-r--r-- | src/gen.rs | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1743,7 +1743,7 @@ fn mk_link_name_attr(ctx: &mut GenCtx, name: String) -> ast::Attribute { respan(ctx.span, attr) } -fn mk_repr_attr(ctx: &mut GenCtx, layout: Layout) -> ast::Attribute { +fn mk_repr_attr(ctx: &GenCtx, layout: Layout) -> ast::Attribute { let mut values = vec!(P(respan(ctx.span, ast::MetaItemKind::Word(InternedString::new("C"))))); if layout.packed { values.push(P(respan(ctx.span, ast::MetaItemKind::Word(InternedString::new("packed"))))); @@ -2263,7 +2263,7 @@ fn mk_opaque_struct(ctx: &GenCtx, name: &str, layout: &Layout) -> P<ast::Item> { P(ast::Item { ident: ctx.ext_cx.ident_of(&name), - attrs: vec![], + attrs: vec![mk_repr_attr(ctx, layout.clone())], id: ast::DUMMY_NODE_ID, node: def, vis: ast::Visibility::Public, |