@@ -18,14 +18,15 @@ mkdir -p "$TEMP_DIR"
1818
1919overall_pass=0
2020overall_fail=0
21+ RUST_NIGHTLY=" ${TUFFY_CRATE_TEST_TOOLCHAIN:- nightly-2026-03-28} "
2122
2223# ── Build ─────────────────────────────────────────────────────────────────────
2324
2425if [ -n " ${BACKEND:- } " ]; then
2526 echo " === Using pre-built backend ==="
2627else
2728 echo " === Build ==="
28- cargo build --manifest-path " $CRATE_ROOT /Cargo.toml" --release
29+ cargo + " $RUST_NIGHTLY " build --manifest-path " $CRATE_ROOT /Cargo.toml" --release
2930 BACKEND=" $CRATE_ROOT /target/release/librustc_codegen_tuffy.so"
3031fi
3132
@@ -62,7 +63,7 @@ cat > "$BITFLAGS_DIR/.cargo/config.toml" <<CFGEOF
6263rustflags = ["-Z", "codegen-backend=$BACKEND "]
6364CFGEOF
6465
65- if cargo +nightly-2026-03-28 test --manifest-path " $BITFLAGS_DIR /Cargo.toml" ; then
66+ if cargo +" $RUST_NIGHTLY " test --manifest-path " $BITFLAGS_DIR /Cargo.toml" ; then
6667 overall_pass=$(( overall_pass + 1 ))
6768else
6869 overall_fail=$(( overall_fail + 1 ))
@@ -73,12 +74,21 @@ echo ""
7374# syn is a widely-used parser crate. Because many proc-macros depend on syn
7475# from crates.io, TUFFY_SRC_DIR restricts the tuffy backend to the workspace
7576# copy of syn (prevents applying tuffy to the registry copy used by proc-macros).
77+ # The checkout is pinned and patched because nightly-2026-03-28 changed
78+ # rustc_ast::UseTree in a way that breaks syn's floating test-suite snapshots.
7679
7780SYN_DIR=" $REPO_ROOT /scratch/syn"
81+ SYN_REV=" ae257c4e05a338f73655aa1fa3d144e047daccf1"
82+ SYN_PATCH=" $SCRIPT_DIR /patches/syn-nightly-2026-03-28.patch"
7883if [ ! -d " $SYN_DIR " ]; then
7984 echo " === Cloning syn ==="
8085 git clone --filter=blob:none https://github.com/dtolnay/syn.git " $SYN_DIR "
8186fi
87+ if ! git -C " $SYN_DIR " cat-file -e " $SYN_REV ^{commit}" 2> /dev/null; then
88+ git -C " $SYN_DIR " fetch --filter=blob:none origin " $SYN_REV "
89+ fi
90+ git -C " $SYN_DIR " checkout --force " $SYN_REV "
91+ git -C " $SYN_DIR " apply " $SYN_PATCH "
8292echo " === Syn cargo test ==="
8393
8494WRAPPER_EXEC=" $TEMP_DIR /rustc-wrapper-tuffy"
@@ -91,7 +101,7 @@ if RUSTC_WRAPPER="$WRAPPER_EXEC" \
91101 TUFFY_BACKEND=" $BACKEND " \
92102 TUFFY_CRATE=" syn" \
93103 TUFFY_SRC_DIR=" $SYN_DIR " \
94- cargo test --manifest-path " $SYN_DIR /Cargo.toml" --all-features; then
104+ cargo + " $RUST_NIGHTLY " test --manifest-path " $SYN_DIR /Cargo.toml" --all-features; then
95105 overall_pass=$(( overall_pass + 1 ))
96106else
97107 overall_fail=$(( overall_fail + 1 ))
@@ -121,19 +131,19 @@ echo "=== Hashbrown release-focused tests ==="
121131if CARGO_TARGET_DIR=" $HASHBROWN_TARGET_DIR " \
122132 RUSTFLAGS=" -Zcodegen-backend=$BACKEND " \
123133 RUSTDOCFLAGS=" -Zcodegen-backend=$BACKEND " \
124- cargo +nightly-2026-03-28 build --manifest-path " $HASHBROWN_DIR /Cargo.toml" --target x86_64-unknown-linux-gnu --no-default-features \
134+ cargo +" $RUST_NIGHTLY " build --manifest-path " $HASHBROWN_DIR /Cargo.toml" --target x86_64-unknown-linux-gnu --no-default-features \
125135 && CARGO_TARGET_DIR=" $HASHBROWN_TARGET_DIR " \
126136 RUSTFLAGS=" -Zcodegen-backend=$BACKEND " \
127137 RUSTDOCFLAGS=" -Zcodegen-backend=$BACKEND " \
128- cargo +nightly-2026-03-28 build --manifest-path " $HASHBROWN_DIR /Cargo.toml" --target x86_64-unknown-linux-gnu --release --no-default-features \
138+ cargo +" $RUST_NIGHTLY " build --manifest-path " $HASHBROWN_DIR /Cargo.toml" --target x86_64-unknown-linux-gnu --release --no-default-features \
129139 && CARGO_TARGET_DIR=" $HASHBROWN_TARGET_DIR " \
130140 RUSTFLAGS=" -Zcodegen-backend=$BACKEND " \
131141 RUSTDOCFLAGS=" -Zcodegen-backend=$BACKEND " \
132- cargo +nightly-2026-03-28 test --manifest-path " $HASHBROWN_DIR /Cargo.toml" --target x86_64-unknown-linux-gnu --release --no-fail-fast \
142+ cargo +" $RUST_NIGHTLY " test --manifest-path " $HASHBROWN_DIR /Cargo.toml" --target x86_64-unknown-linux-gnu --release --no-fail-fast \
133143 && CARGO_TARGET_DIR=" $HASHBROWN_TARGET_DIR " \
134144 RUSTFLAGS=" -Zcodegen-backend=$BACKEND " \
135145 RUSTDOCFLAGS=" -Zcodegen-backend=$BACKEND " \
136- cargo +nightly-2026-03-28 test --manifest-path " $HASHBROWN_DIR /Cargo.toml" --target x86_64-unknown-linux-gnu --release --features rustc-internal-api,serde,rayon,nightly --no-fail-fast; then
146+ cargo +" $RUST_NIGHTLY " test --manifest-path " $HASHBROWN_DIR /Cargo.toml" --target x86_64-unknown-linux-gnu --release --features rustc-internal-api,serde,rayon,nightly --no-fail-fast; then
137147 overall_pass=$(( overall_pass + 1 ))
138148else
139149 overall_fail=$(( overall_fail + 1 ))
0 commit comments