]> git.lizzy.rs Git - rust.git/blobdiff - src/libsyntax_ext/deriving/generic/mod.rs
Auto merge of #49881 - varkor:partialord-opt, r=Manishearth
[rust.git] / src / libsyntax_ext / deriving / generic / mod.rs
index 82ed6a29b779d7eb428fefdce8f81592d92275dd..1f80385cfbd24051b7acf05733918f02ba699a54 100644 (file)
@@ -413,8 +413,12 @@ pub fn expand_ext(self,
         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",