Skip to content

repo: Fix lints for Rust 1.90#2020

Merged
smalis-msft merged 1 commit intomicrosoft:mainfrom
smalis-msft:rust-190-lints
Sep 18, 2025
Merged

repo: Fix lints for Rust 1.90#2020
smalis-msft merged 1 commit intomicrosoft:mainfrom
smalis-msft:rust-190-lints

Conversation

@smalis-msft
Copy link
Contributor

The vast majority of these are a new lint that replaces manual modular arithmetic with the is_multiple_of helper, which were all just applied automatically. There were also a few cases of extra unneeded parentheses, and one new allow(dead_code) in a protocol definitions file since not all of it is used today.

@smalis-msft smalis-msft requested review from a team as code owners September 18, 2025 16:24
Copilot AI review requested due to automatic review settings September 18, 2025 16:24
@smalis-msft smalis-msft requested a review from a team as a code owner September 18, 2025 16:24
@smalis-msft smalis-msft enabled auto-merge (squash) September 18, 2025 16:24
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 PR addresses new Rust 1.90 lints by replacing manual modular arithmetic with the is_multiple_of helper method and removing unnecessary parentheses. The changes are primarily automatic lint fixes with one manual addition of #[allow(dead_code)] for a protocol definitions file.

  • Replaces x % y != 0 with !x.is_multiple_of(y) and x % y == 0 with x.is_multiple_of(y) throughout the codebase
  • Removes redundant parentheses around expressions and type annotations
  • Adds #[allow(dead_code)] to a protocol file where not all definitions are currently used

Reviewed Changes

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

Show a summary per file
File Description
vmm_core/virt_kvm/src/arch/aarch64/mod.rs Replace modular arithmetic with is_multiple_of for GIC alignment checks
vmm_core/src/synic.rs Remove unnecessary parentheses from boxed trait object return types
vm/x86/x86emu/src/emulator.rs Replace modular arithmetic with is_multiple_of for alignment validation
vm/x86/tdcall/src/lib.rs Replace modular arithmetic with is_multiple_of for large page alignment
vm/vmgs/vmgstool/src/main.rs Replace modular arithmetic with is_multiple_of for sector size validation
vm/vmgs/vmgs_lib/src/lib.rs Replace modular arithmetic with is_multiple_of for file size validation
vm/vmgs/vmgs_format/src/lib.rs Replace modular arithmetic with is_multiple_of in const assertions
vm/vmcore/memory_range/src/lib.rs Replace modular arithmetic with is_multiple_of for page alignment
vm/vmcore/guestmem/src/lib.rs Replace modular arithmetic with is_multiple_of and remove redundant parentheses
vm/page_pool_alloc/src/lib.rs Replace modular arithmetic with is_multiple_of for page size validation
vm/loader/src/paravisor.rs Replace modular arithmetic with is_multiple_of for memory alignment checks
vm/loader/src/linux.rs Replace modular arithmetic with is_multiple_of for address alignment
vm/loader/page_table/src/x64.rs Replace modular arithmetic with is_multiple_of for page table alignment
vm/loader/igvmfilegen/src/file_loader.rs Replace modular arithmetic with is_multiple_of for relocation validation
vm/hv1/hv1_hypercall/src/tests.rs Replace modular arithmetic with is_multiple_of in test assertions
vm/hv1/hv1_hypercall/src/support.rs Replace modular arithmetic with is_multiple_of for buffer alignment
vm/devices/vmbus/vmbus_server/src/tests.rs Remove unnecessary parentheses from boxed trait object return types
vm/devices/vmbus/vmbus_ring/src/lib.rs Replace modular arithmetic with is_multiple_of for alignment checks
vm/devices/vmbus/vmbus_channel/src/gpadl_ring.rs Replace modular arithmetic with is_multiple_of for page size validation
vm/devices/vmbus/vmbfs/src/protocol.rs Add #[allow(dead_code)] for unused protocol definitions
vm/devices/virtio/virtiofs/src/section.rs Replace modular arithmetic with is_multiple_of for page size validation
vm/devices/virtio/virtio_p9/src/lib.rs Replace modular arithmetic with is_multiple_of for alignment assertions
vm/devices/user_driver/src/vfio.rs Replace modular arithmetic with is_multiple_of for memory alignment
vm/devices/user_driver/src/lockmem.rs Replace modular arithmetic with is_multiple_of for page size validation
vm/devices/storage/nvme_test/src/workers.rs Replace modular arithmetic with is_multiple_of in const assertion
vm/devices/storage/nvme_resources/src/fault.rs Remove redundant parentheses from comparison expressions
vm/devices/storage/nvme/src/workers.rs Replace modular arithmetic with is_multiple_of in const assertion
vm/devices/storage/disklayer_ram/src/lib.rs Replace modular arithmetic with is_multiple_of for sector size validation
vm/devices/storage/disk_striped/src/lib.rs Replace modular arithmetic with is_multiple_of for chunk size validation
vm/devices/storage/disk_get_vmgs/src/lib.rs Replace modular arithmetic with is_multiple_of for sector count validation
vm/devices/storage/disk_backend/src/sync_wrapper.rs Replace modular arithmetic with is_multiple_of for buffer size checks
vm/devices/pci/pci_core/src/cfg_space_emu.rs Replace modular arithmetic with is_multiple_of for offset alignment
vm/devices/net/netvsp/src/lib.rs Remove redundant parentheses and simplify filter expression
vm/devices/net/net_mana/src/lib.rs Replace modular arithmetic with is_multiple_of in test assertion
vm/devices/net/mana_driver/src/queues.rs Replace modular arithmetic with is_multiple_of for WQE alignment
vm/devices/net/gdma/src/queues.rs Replace modular arithmetic with is_multiple_of for alignment check
vm/devices/net/gdma/src/dma.rs Replace modular arithmetic with is_multiple_of for DMA region alignment
vm/devices/hyperv_ic/src/kvp.rs Replace modular arithmetic with is_multiple_of for string length validation
vm/devices/firmware/uefi_nvram_specvars/src/signature_list.rs Replace modular arithmetic with is_multiple_of for signature size validation
vm/devices/chipset/src/dma.rs Replace modular arithmetic with is_multiple_of for register access
vm/acpi/src/builder.rs Replace modular arithmetic with is_multiple_of for table length alignment
support/ucs2/src/lib.rs Replace modular arithmetic with is_multiple_of for UCS-2 buffer validation
support/sparse_mmap/src/windows.rs Replace modular arithmetic with is_multiple_of for page alignment
support/sparse_mmap/src/unix.rs Replace modular arithmetic with is_multiple_of for page alignment
support/sparse_mmap/fuzz/fuzz_sparse_mmap.rs Replace modular arithmetic with is_multiple_of for page block validation
support/pal/src/unix/process/linux.rs Replace modular arithmetic with is_multiple_of for stack size validation
support/pal/src/unix/affinity.rs Replace modular arithmetic with is_multiple_of for hex string validation
support/fdt/src/parser.rs Replace modular arithmetic with is_multiple_of for buffer alignment
openvmm/hvlite_core/src/worker/vm_loaders/igvm.rs Replace modular arithmetic with is_multiple_of for memory range validation
openhcl/underhill_mem/src/mapping.rs Replace modular arithmetic with is_multiple_of for bitmap alignment
openhcl/sidecar_client/src/lib.rs Replace modular arithmetic with is_multiple_of in const assertion
openhcl/openhcl_boot/src/hypercall.rs Replace modular arithmetic with is_multiple_of for page alignment
openhcl/openhcl_boot/src/arch/x86_64/snp.rs Replace modular arithmetic with is_multiple_of for page alignment
openhcl/openhcl_boot/src/arch/x86_64/memory.rs Replace modular arithmetic with is_multiple_of for large page alignment
openhcl/openhcl_boot/src/arch/x86_64/address_space.rs Replace modular arithmetic with is_multiple_of for virtual address alignment
openhcl/hcl/src/vmsa.rs Replace modular arithmetic with is_multiple_of for register offset alignment
openhcl/hcl/src/ioctl.rs Replace modular arithmetic with is_multiple_of for variable input validation

@smalis-msft smalis-msft merged commit 943cd93 into microsoft:main Sep 18, 2025
29 checks passed
@smalis-msft smalis-msft deleted the rust-190-lints branch September 18, 2025 20:22
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.

2 participants