Upgrade syn to v3 (continues #350) #355
All Vouch review confidence checks passed
Residual risk 0.18 = Change Risk (0.46) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.46 · 478 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.369
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #355"
general
weight: 0.35
jrandolf
Continues #350 by @wojciech-graj. The first commit is theirs, with its author kept. It moves
rstest_macrosandrstest_reusetosyn3.0. The next commits answer the review of #350.The two review points of #350:
use_default_values_attributes: the assertion is back. In syn 3,ItemFnhas a new fieldmodifiers: FnModifiers, andFnModifiershas a fielddefaultness. Soformat!("{:?}", item_fn)always contains "default", and the old assertion!format!("{:?}", item_fn).contains("default")cannot hold. The test checks thatextend_with_function_attrsremoves the#[default(...)]argument attributes. It now compares the function withfn my_fix(f1: &str, f2: (Vec<u32>, &str)) {}. It fails when the attributes stay: I checked this with aJustOnceFnArgAttributeExtractorthat keeps them.#[timeout(some -> strange -> invalid -> expression)]changes fromerror: expected an expressiontoerror: unexpected token. The text comes from syn (Attribute::parse_args::<Expr>()), not from rstest. syn 3.0.8 (syn#2086 and syn#2087) changed how->and<-are parsed in expressions. Before,some -> strangewassome -with no right side, and the error was at the>. Now it issomefollowed by an unexpected->, and the error is at the-. syn 3.0.0 to 3.0.7 give the old error, sorstest_macrosnow requires syn 3.0.8. The expected text inrstest/tests/rstest/mod.rschanges from112:17to112:16.That test is the only expected output that changes. I built the 107 files in
rstest/tests/resourcesandrstest_reuse/tests/resourceswith master and with this branch, on stable, beta and nightly, and compared the compiler output. Only the file with that error differs, apart from the random macro names in tworstest_reusewarnings. On nightly I also compared the macro-expanded source (-Zunpretty=expanded): it is the same, except for the random macro names ofrstest_reuse.Other syn 3 changes that touch rstest:
Signature::unsafetyis nowSignature::safety. rstest reads it only in theitemfn_near_matchtest helper (changed in #350).a <-b, as rustc does. syn 2 read it asa < -b, so#[case(1 <-2)]compiled. Now it needs#[case(1 < -2)]. The CHANGELOG says so.The other changes in the syn 3.0.0 release notes (
Type::BareFn,Arm::guard,Punctuated::pop,visitof spans and the rest) are not used by rstest. The featuresfull,parsing,extra-traits,visitandvisit-mutstill exist.MSRV is not changed (1.85).
rust-versionis 1.71 for syn 3.0.10, proc-macro2 1.0.107, quote 1.0.47 and unicode-ident 1.0.27. Themsrvjob of #350 failed withactix-macros@0.2.5 requires rustc 1.88, a dev dependency ofrstest. It was not a syn problem, and #352 fixed it (resolver 3). The job passes here.cargo tree -e normal,build -dshows onesyn(3.0.10) forrstest_macrosand forrstest.rstest_reusebuildssyn2 as well, throughrand0.8 (zerocopy-derive). Before this change it built onlysyn2.Tests:
cargo fmt --all -- --checkandcargo clippy --allare clean.RSTEST_TEST_CHANNEL=stable|beta|nightly cargo test --allpasses, with nightly as the default toolchain as in CI.cargo hack check/test --rust-version --workspace --ignore-privatepasses with Rust 1.85.1.rstest_macrosunit tests pass withsynpinned to 3.0.8, the lower bound.Testworkflow (ubuntu, windows, msrv) passes for these commits on my fork: https://github.com/jrandolf/rstest/actions/runs/43042100257Not tested: downstream projects (for example
trybuildfiles with the old#[timeout(...)]error), the integration tests withsynpinned to 3.0.8, and a macOS or Windows run on my machine (Windows ran only in CI).