Skip to content

Conversation

@wmmc88
Copy link
Collaborator

@wmmc88 wmmc88 commented Sep 12, 2025

This pull request refactors the way assertions are performed when validating the size of the WDF function table in several macro-generated test files. The previous pattern using a match statement has been replaced with a more concise if !... conditional, simplifying the code and improving readability.

This essentially reverts the expansion changes made in #501 because of the nightly rustc change that was reverted in rust-lang/rust#146428

Assertion logic refactor:

  • Replaced the nested match statement with a direct if !isize::try_from(...).is_ok() check for validating the conversion of the WDF function count and size to isize, followed by a panic if the assertion fails, across all affected test output files. [1] [2] [3] [4] [5] [6] [7] [8]

Copilot AI review requested due to automatic review settings September 12, 2025 18:28
@wmmc88 wmmc88 self-assigned this Sep 12, 2025
Copy link
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

This pull request reverts macro expansion test output changes to match a nightly rustc change that was reverted upstream. The changes simplify assertion logic for validating WDF function table size calculations.

  • Replaces verbose match statement assertions with concise if !... conditional checks
  • Updates macro-generated test output files to reflect the reverted rustc behavior
  • Maintains the same assertion functionality with improved readability

Reviewed Changes

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

Show a summary per file
File Description
wdf_verifier_dbg_break_point.expanded.rs Updates assertion pattern from match to if conditional
wdf_spin_lock_acquire.expanded.rs Updates assertion pattern from match to if conditional
wdf_request_retrieve_output_buffer.expanded.rs Updates assertion pattern from match to if conditional
wdf_driver_create.expanded.rs Updates assertion pattern from match to if conditional
wdf_device_create_device_interface.expanded.rs Updates assertion pattern from match to if conditional
wdf_device_create.expanded.rs Updates assertion pattern from match to if conditional
bug_unused_imports.expanded.rs Updates assertion pattern from match to if conditional
bug_tuple_struct_shadowing.expanded.rs Updates assertion pattern from match to if conditional

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@wmmc88 wmmc88 marked this pull request as ready for review September 12, 2025 18:31
@wmmc88 wmmc88 added this pull request to the merge queue Sep 12, 2025
Merged via the queue into microsoft:main with commit b22f660 Sep 12, 2025
229 checks passed
@wmmc88 wmmc88 deleted the update-nightly-macrotest branch September 12, 2025 20:59
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.

3 participants