diff --git a/tracing-attributes/Cargo.toml b/tracing-attributes/Cargo.toml index 53f67613cb..ae20aa23da 100644 --- a/tracing-attributes/Cargo.toml +++ b/tracing-attributes/Cargo.toml @@ -35,7 +35,7 @@ proc-macro = true [dependencies] proc-macro2 = "1.0.40" -syn = { version = "1.0.98", default-features = false, features = ["full", "parsing", "printing", "visit-mut", "clone-impls", "extra-traits", "proc-macro"] } +syn = { version = "2.0", default-features = false, features = ["full", "parsing", "printing", "visit-mut", "clone-impls", "extra-traits", "proc-macro"] } quote = "1.0.20" [dev-dependencies] @@ -43,7 +43,7 @@ tracing = { path = "../tracing", version = "0.2" } tracing-mock = { path = "../tracing-mock", features = ["tokio-test"] } tokio-test = "0.4.2" tracing-subscriber = { path = "../tracing-subscriber", version = "0.3", features = ["env-filter"] } -async-trait = "0.1.56" +async-trait = "0.1.67" trybuild = "1.0.64" rustversion = "1.0.9" diff --git a/tracing-attributes/src/attr.rs b/tracing-attributes/src/attr.rs index 6bb586ef40..a1854c7e80 100644 --- a/tracing-attributes/src/attr.rs +++ b/tracing-attributes/src/attr.rs @@ -239,7 +239,7 @@ impl Parse for Skips { let _ = input.parse::(); let content; let _ = syn::parenthesized!(content in input); - let names: Punctuated = content.parse_terminated(Ident::parse_any)?; + let names = content.parse_terminated(Ident::parse_any, Token![,])?; let mut skips = HashSet::new(); for name in names { if skips.contains(&name) { @@ -290,7 +290,7 @@ impl Parse for Fields { let _ = input.parse::(); let content; let _ = syn::parenthesized!(content in input); - let fields: Punctuated<_, Token![,]> = content.parse_terminated(Field::parse)?; + let fields = content.parse_terminated(Field::parse, Token![,])?; Ok(Self(fields)) } } @@ -335,7 +335,7 @@ impl ToTokens for Field { let name = &self.name; let kind = &self.kind; tokens.extend(quote! { - #name = #kind#value + #name = #kind #value }) } else if self.kind == FieldKind::Value { // XXX(eliza): I don't like that fields without values produce diff --git a/tracing-attributes/src/expand.rs b/tracing-attributes/src/expand.rs index 2e1cda8e3d..d71366c663 100644 --- a/tracing-attributes/src/expand.rs +++ b/tracing-attributes/src/expand.rs @@ -477,10 +477,7 @@ fn param_names(pat: Pat, record_type: RecordType) -> Box Box::new( + Pat::TupleStruct(PatTupleStruct { elems, .. }) => Box::new( elems .into_iter() .flat_map(|p| param_names(p, RecordType::Debug)), @@ -564,7 +561,7 @@ impl<'block> AsyncInfo<'block> { // last expression of the block: it determines the return value of the // block, this is quite likely a `Box::pin` statement or an async block let (last_expr_stmt, last_expr) = block.stmts.iter().rev().find_map(|stmt| { - if let Stmt::Expr(expr) = stmt { + if let Stmt::Expr(expr, _semi) = stmt { Some((stmt, expr)) } else { None