From e26f57d0d340fce1f69bbb7211643e7a5012b071 Mon Sep 17 00:00:00 2001 From: Alekos Filini Date: Mon, 29 Mar 2021 13:41:00 +0200 Subject: [PATCH 1/3] Correctly consume tokens when parsing `js_namespace` `syn` < 1.0.66 would consume the `AnyIdent` anyway while trying to parse the `ExprArray`. Now due to a refactoring they did, they (correctly) leave the `ParseBuffer` untouched if the input is not a valid `ExprArray`, so we should avoid forking the input buffer and just use the same for both tries, otherwise the unwanted tokens left in there would make `Punctuated` break soon after. Fixes #2508 --- crates/macro-support/src/parser.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crates/macro-support/src/parser.rs b/crates/macro-support/src/parser.rs index 22c72042b79..bf3ff55aaad 100644 --- a/crates/macro-support/src/parser.rs +++ b/crates/macro-support/src/parser.rs @@ -299,7 +299,6 @@ impl Parse for BindgenAttr { (@parser $variant:ident(Span, Vec, Vec)) => ({ input.parse::()?; - let input_before_parse = input.fork(); let (vals, spans) = match input.parse::() { Ok(exprs) => { let mut vals = vec![]; @@ -320,7 +319,7 @@ impl Parse for BindgenAttr { (vals, spans) }, Err(_) => { - let ident = input_before_parse.parse::()?.0; + let ident = input.parse::()?.0; (vec![ident.to_string()], vec![ident.span()]) } }; From 0cf36e6b216654cc460954dffcce4061b96f1dc6 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 29 Mar 2021 06:59:03 -0700 Subject: [PATCH 2/3] Update nightly used on CI --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d9fa449d3ec..15d285a1636 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -87,7 +87,7 @@ jobs: steps: - template: ci/azure-install-rust.yml parameters: - toolchain: nightly-2021-01-23 + toolchain: nightly-2021-03-28 - template: ci/azure-install-node.yml - script: cargo test --target wasm32-unknown-unknown --features nightly --test wasm From 94b119f87eeb454d88a361a7878b228fcacdc27a Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 29 Mar 2021 06:59:30 -0700 Subject: [PATCH 3/3] Update syn version dependency --- crates/macro-support/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/macro-support/Cargo.toml b/crates/macro-support/Cargo.toml index aadaaf97d3a..f1728537fa0 100644 --- a/crates/macro-support/Cargo.toml +++ b/crates/macro-support/Cargo.toml @@ -17,7 +17,7 @@ extra-traits = ["syn/extra-traits"] strict-macro = [] [dependencies] -syn = { version = '1.0.27', features = ['visit', 'full'] } +syn = { version = '1.0.67', features = ['visit', 'full'] } quote = '1.0' proc-macro2 = "1.0" wasm-bindgen-backend = { path = "../backend", version = "=0.2.72" }