about summary refs log tree commit diff
path: root/src/libsyntax_ext
diff options
context:
space:
mode:
authorCameron Hart <cameron.hart@gmail.com>2018-02-04 22:10:28 +1100
committerCameron Hart <cameron.hart@gmail.com>2018-04-11 22:13:13 +1000
commit15d1c4d2139611fcb87a2c802bd015b5f4f0aed8 (patch)
tree5822428a8e6a8ef94f13ea80f22d8ec01545f33b /src/libsyntax_ext
parentca26ef321c44358404ef788d315c4557eb015fb2 (diff)
downloadrust-15d1c4d2139611fcb87a2c802bd015b5f4f0aed8.tar.gz
rust-15d1c4d2139611fcb87a2c802bd015b5f4f0aed8.zip
Implementation of `#[repr(packed(n))]` RFC 1399.
Diffstat (limited to 'src/libsyntax_ext')
-rw-r--r--src/libsyntax_ext/deriving/generic/mod.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/libsyntax_ext/deriving/generic/mod.rs b/src/libsyntax_ext/deriving/generic/mod.rs
index 4126ce79f35..66053e037e1 100644
--- a/src/libsyntax_ext/deriving/generic/mod.rs
+++ b/src/libsyntax_ext/deriving/generic/mod.rs
@@ -413,8 +413,12 @@ impl<'a> TraitDef<'a> {
         match *item {
             Annotatable::Item(ref item) => {
                 let is_packed = item.attrs.iter().any(|attr| {
-                    attr::find_repr_attrs(&cx.parse_sess.span_diagnostic, attr)
-                        .contains(&attr::ReprPacked)
+                    for r in attr::find_repr_attrs(&cx.parse_sess.span_diagnostic, attr) {
+                        if let attr::ReprPacked(_) = r {
+                            return true;
+                        }
+                    }
+                    false
                 });
                 let has_no_type_params = match item.node {
                     ast::ItemKind::Struct(_, ref generics) |
@@ -831,7 +835,7 @@ fn find_repr_type_name(diagnostic: &Handler, type_attrs: &[ast::Attribute]) -> &
     for a in type_attrs {
         for r in &attr::find_repr_attrs(diagnostic, a) {
             repr_type_name = match *r {
-                attr::ReprPacked | attr::ReprSimd | attr::ReprAlign(_) | attr::ReprTransparent =>
+                attr::ReprPacked(_) | attr::ReprSimd | attr::ReprAlign(_) | attr::ReprTransparent =>
                     continue,
 
                 attr::ReprC => "i32",