Skip to content

Commit 82fa94d

Browse files
bors[bot]jannic
andauthored
Merge #474
474: Upgrade syn to version 2.0 r=adamgreig a=jannic Co-authored-by: Jan Niehusmann <jan@gondor.com>
2 parents 067af84 + c50d575 commit 82fa94d

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

cortex-m-rt/macros/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ proc-macro2 = "1.0"
2020

2121
[dependencies.syn]
2222
features = ["extra-traits", "full"]
23-
version = "1.0"
23+
version = "2.0"

cortex-m-rt/macros/src/lib.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -553,8 +553,8 @@ fn extract_static_muts(
553553
let mut stmts = vec![];
554554
for stmt in istmts.by_ref() {
555555
match stmt {
556-
Stmt::Item(Item::Static(var)) => {
557-
if var.mutability.is_some() {
556+
Stmt::Item(Item::Static(var)) => match var.mutability {
557+
syn::StaticMutability::Mut(_) => {
558558
if seen.contains(&var.ident) {
559559
return Err(parse::Error::new(
560560
var.ident.span(),
@@ -564,10 +564,9 @@ fn extract_static_muts(
564564

565565
seen.insert(var.ident.clone());
566566
statics.push(var);
567-
} else {
568-
stmts.push(Stmt::Item(Item::Static(var)));
569567
}
570-
}
568+
_ => stmts.push(Stmt::Item(Item::Static(var))),
569+
},
571570
_ => {
572571
stmts.push(stmt);
573572
break;
@@ -645,5 +644,5 @@ fn check_attr_whitelist(attrs: &[Attribute], caller: WhiteListCaller) -> Result<
645644

646645
/// Returns `true` if `attr.path` matches `name`
647646
fn eq(attr: &Attribute, name: &str) -> bool {
648-
attr.style == AttrStyle::Outer && attr.path.is_ident(name)
647+
attr.style == AttrStyle::Outer && attr.path().is_ident(name)
649648
}

0 commit comments

Comments
 (0)