From 9ef751bcd94dc3b348cbacc506091aeee2917614 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Thu, 31 Aug 2023 11:25:56 +0200 Subject: [PATCH] Upgrade syn to 2.0 (#499) --- html5ever/Cargo.toml | 2 +- html5ever/macros/match_token.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/html5ever/Cargo.toml b/html5ever/Cargo.toml index 39e79992..8dfd194a 100644 --- a/html5ever/Cargo.toml +++ b/html5ever/Cargo.toml @@ -24,7 +24,7 @@ criterion = "0.3" [build-dependencies] quote = "1" -syn = { version = "1", features = ["extra-traits", "full", "fold"] } +syn = { version = "2", features = ["extra-traits", "full", "fold"] } proc-macro2 = "1" [[bench]] diff --git a/html5ever/macros/match_token.rs b/html5ever/macros/match_token.rs index 9fbed082..b4bff19f 100644 --- a/html5ever/macros/match_token.rs +++ b/html5ever/macros/match_token.rs @@ -197,7 +197,7 @@ impl Parse for LHS { } Ok(LHS::Tags(tags)) } else { - let p: syn::Pat = input.parse()?; + let p = input.call(syn::Pat::parse_single)?; Ok(LHS::Pattern(p)) } } @@ -423,7 +423,7 @@ impl Fold for MatchTokenParser { if mac.path == parse_quote!(match_token) { return syn::fold::fold_stmt( self, - syn::Stmt::Expr(expand_match_token(&mac.tokens)), + syn::Stmt::Expr(expand_match_token(&mac.tokens), None), ); } },