summary refs log tree commit diff
path: root/enumn
diff options
context:
space:
mode:
authorDylan Reid <dgreid@chromium.org>2020-01-28 12:31:15 -0800
committerCommit Bot <commit-bot@chromium.org>2020-02-06 05:28:15 +0000
commit672559f91ae54664fc1f76326c0ecc4008da4c09 (patch)
tree05a1d14081aefbc91dcc3a3c4e3988688f1b84ee /enumn
parent3eb7927bcd1aeb5578aab3109b9fb90c7a641af5 (diff)
downloadcrosvm-672559f91ae54664fc1f76326c0ecc4008da4c09.tar
crosvm-672559f91ae54664fc1f76326c0ecc4008da4c09.tar.gz
crosvm-672559f91ae54664fc1f76326c0ecc4008da4c09.tar.bz2
crosvm-672559f91ae54664fc1f76326c0ecc4008da4c09.tar.lz
crosvm-672559f91ae54664fc1f76326c0ecc4008da4c09.tar.xz
crosvm-672559f91ae54664fc1f76326c0ecc4008da4c09.tar.zst
crosvm-672559f91ae54664fc1f76326c0ecc4008da4c09.zip
Update syn, quote, and proc-macro past 1.0
These were pinned at pre-1.0 versions. Update to the stable API to allow
new features to be used in the future.

Cq-Depend: chromium:2026764
Change-Id: Id2d979525e5210436cbb1cfa61e2b05fafb288f3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2025907
Tested-by: Dylan Reid <dgreid@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dylan Reid <dgreid@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
Diffstat (limited to 'enumn')
-rw-r--r--enumn/Cargo.toml6
-rw-r--r--enumn/src/lib.rs16
2 files changed, 12 insertions, 10 deletions
diff --git a/enumn/Cargo.toml b/enumn/Cargo.toml
index 1708678..381c3d7 100644
--- a/enumn/Cargo.toml
+++ b/enumn/Cargo.toml
@@ -8,6 +8,6 @@ edition = "2018"
 proc-macro = true
 
 [dependencies]
-proc-macro2 = "0.4"
-quote = "0.6"
-syn = "0.15"
+proc-macro2 = "^1"
+quote = "^1"
+syn = "^1"
diff --git a/enumn/src/lib.rs b/enumn/src/lib.rs
index 7a04303..1441b4b 100644
--- a/enumn/src/lib.rs
+++ b/enumn/src/lib.rs
@@ -134,14 +134,16 @@ fn testable_derive(input: DeriveInput) -> proc_macro2::TokenStream {
     let mut repr = None;
     for attr in input.attrs {
         if let Ok(Meta::List(list)) = attr.parse_meta() {
-            if list.ident == "repr" {
-                if let Some(NestedMeta::Meta(Meta::Word(word))) = list.nested.into_iter().next() {
-                    match word.to_string().as_str() {
-                        "u8" | "u16" | "u32" | "u64" | "u128" | "usize" | "i8" | "i16" | "i32"
-                        | "i64" | "i128" | "isize" => {
-                            repr = Some(word);
+            if list.path.is_ident("repr") {
+                if let Some(NestedMeta::Meta(Meta::Path(word))) = list.nested.into_iter().next() {
+                    if let Some(s) = word.get_ident() {
+                        match s.to_string().as_str() {
+                            "u8" | "u16" | "u32" | "u64" | "u128" | "usize" | "i8" | "i16"
+                            | "i32" | "i64" | "i128" | "isize" => {
+                                repr = Some(word);
+                            }
+                            _ => {}
                         }
-                        _ => {}
                     }
                 }
             }