diff options
author | 2023-03-21 18:55:00 +0000 | |
---|---|---|
committer | 2023-03-21 18:55:00 +0000 | |
commit | 82fa94d2cd2829cc37111d247e913cecdad561ac (patch) | |
tree | 1fc03a86976a37c9d727db2fd6d57c9e88a62148 | |
parent | 067af8406f306bf8fba53ce738e441a8ba7fefe1 (diff) | |
parent | c50d57508d12993064439010d8edb222845301ff (diff) | |
download | cortex-m-82fa94d2cd2829cc37111d247e913cecdad561ac.tar.gz cortex-m-82fa94d2cd2829cc37111d247e913cecdad561ac.tar.zst cortex-m-82fa94d2cd2829cc37111d247e913cecdad561ac.zip |
Merge #474
474: Upgrade syn to version 2.0 r=adamgreig a=jannic
Co-authored-by: Jan Niehusmann <jan@gondor.com>
-rw-r--r-- | cortex-m-rt/macros/Cargo.toml | 2 | ||||
-rw-r--r-- | cortex-m-rt/macros/src/lib.rs | 11 |
2 files changed, 6 insertions, 7 deletions
diff --git a/cortex-m-rt/macros/Cargo.toml b/cortex-m-rt/macros/Cargo.toml index e95cc7d..f548e19 100644 --- a/cortex-m-rt/macros/Cargo.toml +++ b/cortex-m-rt/macros/Cargo.toml @@ -20,4 +20,4 @@ proc-macro2 = "1.0" [dependencies.syn] features = ["extra-traits", "full"] -version = "1.0" +version = "2.0" diff --git a/cortex-m-rt/macros/src/lib.rs b/cortex-m-rt/macros/src/lib.rs index 0641c73..27ee2f1 100644 --- a/cortex-m-rt/macros/src/lib.rs +++ b/cortex-m-rt/macros/src/lib.rs @@ -553,8 +553,8 @@ fn extract_static_muts( let mut stmts = vec![]; for stmt in istmts.by_ref() { match stmt { - Stmt::Item(Item::Static(var)) => { - if var.mutability.is_some() { + Stmt::Item(Item::Static(var)) => match var.mutability { + syn::StaticMutability::Mut(_) => { if seen.contains(&var.ident) { return Err(parse::Error::new( var.ident.span(), @@ -564,10 +564,9 @@ fn extract_static_muts( seen.insert(var.ident.clone()); statics.push(var); - } else { - stmts.push(Stmt::Item(Item::Static(var))); } - } + _ => stmts.push(Stmt::Item(Item::Static(var))), + }, _ => { stmts.push(stmt); break; @@ -645,5 +644,5 @@ fn check_attr_whitelist(attrs: &[Attribute], caller: WhiteListCaller) -> Result< /// Returns `true` if `attr.path` matches `name` fn eq(attr: &Attribute, name: &str) -> bool { - attr.style == AttrStyle::Outer && attr.path.is_ident(name) + attr.style == AttrStyle::Outer && attr.path().is_ident(name) } |