Skip to content

fix: make the declared 1.85 MSRV true — remove the one let-chain#1

Merged
yuanhao merged 1 commit into
mainfrom
fix/msrv-1.85-let-chain
Jul 11, 2026
Merged

fix: make the declared 1.85 MSRV true — remove the one let-chain#1
yuanhao merged 1 commit into
mainfrom
fix/msrv-1.85-let-chain

Conversation

@yuanhao

@yuanhao yuanhao commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator

What

rust-version = "1.85" is currently inaccurate: src/query.rs uses a let-chain, which stabilized in Rust 1.88. On any toolchain in the declared range, the crate fails with:

error[E0658]: `let` expressions in this position are unstable

Cargo doesn't verify rust-version against the code, so this shipped silently in 0.4.x. It was caught downstream: yoagent's 1.86 MSRV CI job broke when it added yoagent-state behind its new gasp feature (yologdev/yoagent#68) and had to exclude the feature from MSRV checking with a "fix upstream" note — this is that fix.

The fix

The single let-chain (there's exactly one, grep-verified) rewritten as a plain nested if/if let — identical semantics, valid since Rust 1.0. A comment marks the reason so it doesn't get "simplified" back.

Verification

  • cargo test — 15/15 pass
  • cargo clippy --all-targets — unchanged vs main (2 pre-existing warnings elsewhere; no collapsible_if fired on the rewrite)
  • The fix removes a post-1.85 feature rather than adding anything, so 1.85 compatibility follows by construction

Follow-up (downstream)

Once this lands in a 0.4.2 release, yoagent can drop its MSRV carve-out and check --all-features (including gasp) on 1.86 again.

🤖 Generated with Claude Code

query.rs used a let-chain (`if x && let Some(..) = ..`), stable only since
Rust 1.88 — so builds on the declared rust-version = "1.85" failed with
E0658 ("`let` expressions in this position are unstable"). This was caught
downstream: yoagent's 1.86 MSRV CI job broke the moment it added
yoagent-state as a dependency and had to exclude the feature.

Rewritten as a plain nested if-let (identical semantics); a comment marks
why, so it isn't "simplified" back into a let-chain. No behavior change;
all 15 tests pass; clippy is unchanged (no collapsible_if fired).

With this released, downstream crates with MSRVs in the 1.85-1.87 range can
depend on yoagent-state again without carve-outs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@yuanhao yuanhao merged commit 9914d6d into main Jul 11, 2026
@yuanhao yuanhao deleted the fix/msrv-1.85-let-chain branch July 11, 2026 09:07
yuanhao added a commit to yologdev/yoagent that referenced this pull request Jul 11, 2026
)

yoagent-state 0.4.2 makes its declared 1.85 MSRV true (let-chain removed
upstream in yologdev/yoagent-state#1), so the gasp feature can be MSRV-
checked again. Floor bumped to 0.4.2 so a 1.86 toolchain can never resolve
the broken 0.4.1. The stale docs caveat is removed.

Downstream verified against 0.4.2 before this change: yoagent's 392 tests,
yoyo-evolve's gasp-emit (compiles), yyds-harness (0.2.x range, unaffected).
This PR's own MSRV job is the final verdict for the 1.86 + --all-features
combination.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant