Skip to content

Commit e122c48

Browse files
committed
build(rust): pin toolchain to 1.96.0 + fix the two 1.96-only clippy lints
Root-causes the recurring Build-Check skew. CI installs floating `stable` (now 1.96) via dtolnay/rust-toolchain@stable, but local dev had drifted to an older stable (1.94) whose clippy could not see two `collapsible_match` lints 1.96 flags -- so #85's clippy pass (run on 1.94) still left main Build-Check red. - rust-toolchain.toml pins channel = "1.96.0" (+ clippy, rustfmt) so `cargo` uses the SAME toolchain locally and in CI, removing the silent skew. - Fix the two 1.96 `collapsible_match` lints (clippy --fix -> match guards), behaviour-preserving: * src/lsp/handlers/definition.rs (TypeDef goto-definition arm) * src/vm/optimizer.rs (JumpIfFalse/JumpIfTrue nop-removal arm) Verified with the pinned 1.96.0: `cargo clippy -- -D warnings` exit 0, `cargo fmt --check` clean, `cargo test --lib` 173/173 passing. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013wg3Mtq2QFhYi4XVw1Z6z7
1 parent ab94e64 commit e122c48

3 files changed

Lines changed: 25 additions & 12 deletions

File tree

rust-toolchain.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# SPDX-License-Identifier: MPL-2.0
2+
# Pin the Rust toolchain so local builds and CI use the SAME compiler + clippy.
3+
#
4+
# Why this exists: CI installs `stable` (dtolnay/rust-toolchain@stable in
5+
# .github/workflows/security.yml + e2e.yml). When a developer's local `stable`
6+
# lagged CI's, clippy versions diverged (1.94 local vs 1.96 CI) and the
7+
# `Build Check` gate (`cargo clippy -- -D warnings`) failed on `main` with
8+
# `collapsible_match` lints that local clippy could not see. Pinning a single
9+
# version makes `cargo clippy` / `cargo fmt` deterministic across local and CI.
10+
#
11+
# Bump this deliberately (and re-run `cargo clippy` + `cargo fmt` locally)
12+
# rather than letting `stable` drift underneath the lint gate.
13+
[toolchain]
14+
channel = "1.96.0"
15+
components = ["clippy", "rustfmt"]

src/lsp/handlers/definition.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,12 @@ pub async fn goto_definition(
6363
})));
6464
}
6565
}
66-
TopLevelItem::TypeDef(type_def) => {
67-
if type_def.name == word {
68-
let range = span_to_range(&type_def.span, &doc.source);
69-
return Ok(Some(GotoDefinitionResponse::Scalar(Location {
70-
uri: uri.clone(),
71-
range,
72-
})));
73-
}
66+
TopLevelItem::TypeDef(type_def) if type_def.name == word => {
67+
let range = span_to_range(&type_def.span, &doc.source);
68+
return Ok(Some(GotoDefinitionResponse::Scalar(Location {
69+
uri: uri.clone(),
70+
range,
71+
})));
7472
}
7573
_ => {}
7674
}

src/vm/optimizer.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -282,10 +282,10 @@ impl Optimizer {
282282
*target = new_indices[*target];
283283
}
284284
}
285-
OpCode::JumpIfFalse(ref mut target) | OpCode::JumpIfTrue(ref mut target) => {
286-
if *target < new_indices.len() {
287-
*target = new_indices[*target];
288-
}
285+
OpCode::JumpIfFalse(ref mut target) | OpCode::JumpIfTrue(ref mut target)
286+
if *target < new_indices.len() =>
287+
{
288+
*target = new_indices[*target];
289289
}
290290
_ => {}
291291
}

0 commit comments

Comments
 (0)