From c50d57508d12993064439010d8edb222845301ff Mon Sep 17 00:00:00 2001 From: Jan Niehusmann Date: Sat, 18 Mar 2023 10:24:13 +0000 Subject: Upgrade syn to version 2.0 --- cortex-m-rt/macros/src/lib.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'cortex-m-rt/macros/src/lib.rs') 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) } -- cgit v1.2.3