Skip to content

refactor: fix collapsable_if lint, rust 1.95 assert_matches destabilization#643

Merged
leon-xd merged 4 commits intomicrosoft:mainfrom
leon-xd:fix-collapsible-if
Apr 16, 2026
Merged

refactor: fix collapsable_if lint, rust 1.95 assert_matches destabilization#643
leon-xd merged 4 commits intomicrosoft:mainfrom
leon-xd:fix-collapsible-if

Conversation

@leon-xd
Copy link
Copy Markdown
Contributor

@leon-xd leon-xd commented Apr 16, 2026

Fixes collapsable_if lint failing in CI pipelines.

The assert_matches stabilization that was expected to ship with Rust 1.95.0 was reverted from the 1.95 beta due to an inconsistency in temporary scoping behavior between assert_matches!/assert_eq! and their debug_ variants.

We gated assert_matches usage based on the nightly compiler warning that the feature was "stable since 1.95.0" (see #612). Since the stabilization was reverted before the actual release, this gate now fires on stable 1.95 and tries to use an unstable API, breaking CI pipelines.

This bumps the gate to 1.96.0. Beta 1.96 currently still has assert_matches available, though that may change if the destabilization propagates.

Copilot AI review requested due to automatic review settings April 16, 2026 18:17
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates wdk-build to satisfy newer Clippy’s collapsible_if lint by converting nested if let/if patterns into let-chains, unblocking CI lint runs.

Changes:

  • Collapse a nested if let + if in CompilationOptions::parse_cargo_args into a single let-chain guard.
  • Collapse a nested if let + pattern match + equality check in bindgen callbacks into a single let-chain guard.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
crates/wdk-build/src/cargo_make.rs Converts the cargo-make “release profile vs forwarded --profile” conflict check into a let-chain form.
crates/wdk-build/src/bindgen.rs Converts the WDF function table symbol rename override logic into a let-chain form.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 16, 2026

Codecov Report

❌ Patch coverage is 0% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.47%. Comparing base (2b992bc) to head (50a5d6c).

Files with missing lines Patch % Lines
crates/wdk-build/src/cargo_make.rs 0.00% 4 Missing ⚠️
crates/wdk-build/src/bindgen.rs 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #643      +/-   ##
==========================================
+ Coverage   77.42%   77.47%   +0.04%     
==========================================
  Files          24       24              
  Lines        4851     4848       -3     
  Branches     4851     4848       -3     
==========================================
  Hits         3756     3756              
+ Misses        978      975       -3     
  Partials      117      117              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@leon-xd leon-xd changed the title fix: collapse nested if-let chains for new clippy lint fix: 1.95 rust updates for nested if-let chains, assert_matches Apr 16, 2026
@leon-xd leon-xd changed the title fix: 1.95 rust updates for nested if-let chains, assert_matches fix: rust 1.95 updates for collapsable_if lint, assert_matches destabilization Apr 16, 2026
Copilot AI review requested due to automatic review settings April 16, 2026 20:19
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/wdk-build/build.rs
Comment thread crates/wdk-build/build.rs Outdated
Copy link
Copy Markdown
Collaborator

@wmmc88 wmmc88 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the PR description is a little messy. can't quite pin down why it seems off. also i think this should be labelled refactor: fix xyz lint based off past lint fix prs

@leon-xd leon-xd changed the title fix: rust 1.95 updates for collapsable_if lint, assert_matches destabilization refactor: fix collapsable_if lint, rust 1.95 assert_matches destabilization Apr 16, 2026
@leon-xd leon-xd enabled auto-merge April 16, 2026 21:25
@leon-xd leon-xd added this pull request to the merge queue Apr 16, 2026
Merged via the queue into microsoft:main with commit 2940ef8 Apr 16, 2026
229 checks passed
@leon-xd leon-xd deleted the fix-collapsible-if branch April 16, 2026 23:18
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.

5 participants