Skip to content

Conversation

@smalis-msft
Copy link
Contributor

Remove some unneeded attributes, move some around, tweak some to be cleaner, add some more forbid(unsafe_code)s.

@smalis-msft smalis-msft requested a review from a team as a code owner October 21, 2025 19:15
Copilot AI review requested due to automatic review settings October 21, 2025 19:15
@smalis-msft smalis-msft requested a review from a team as a code owner October 21, 2025 19:15
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 cleans up Rust attributes across the codebase by adding #![forbid(unsafe_code)] to files that don't require unsafe operations, reorganizing attribute placement for better consistency, and removing redundant conditional compilation attributes.

Key Changes:

  • Added #![forbid(unsafe_code)] to 14 files that don't use unsafe operations
  • Consolidated conditional compilation attributes (moved #![cfg(...)] closer to module docs and removed redundant cfg_attr patterns)
  • Simplified test attribute logic in lxutil/src/lib.rs

Reviewed Changes

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

Show a summary per file
File Description
xtask/src/main.rs Added #![forbid(unsafe_code)]
vmm_tests/vmm_tests/tests/tmks.rs Added #![forbid(unsafe_code)]
vmm_tests/vmm_tests/tests/tests/main.rs Added #![forbid(unsafe_code)]
vm/vmgs/vmgstool/src/main.rs Added #![forbid(unsafe_code)]
vm/loader/igvmfilegen/src/main.rs Added #![forbid(unsafe_code)]
vm/devices/vmbus/vmbus_client_hcl/src/lib.rs Removed cfg_attr and moved #![cfg(target_os = "linux")] below module doc
vm/devices/support/fs/lxutil/src/lib.rs Simplified test cfg attribute from any(unix, not(feature = "ci")) to not(all(windows, feature = "ci"))
support/pal/pal_uring/src/lib.rs Removed cfg_attr and moved #![cfg(target_os = "linux")] below module doc
support/inspect_rlimit/src/lib.rs Moved module doc above #![cfg(target_os = "linux")]
support/cache_topology/src/lib.rs Moved unsafe_code expectation from crate level to module level
support/atomic_ringbuf/src/lib.rs Added #![forbid(unsafe_code)]
petri/pipette/src/trace.rs Removed redundant #![cfg(...)]
petri/pipette/src/shutdown.rs Removed redundant #![cfg(...)]
petri/pipette/src/main.rs Added conditional #![forbid(unsafe_code)] for non-Windows, consolidated cfg attributes, replaced macOS-specific stub
petri/pipette/src/execute.rs Removed redundant #![cfg(...)]
petri/pipette/src/agent.rs Removed redundant #![cfg(...)]
petri/petri-tool/src/main.rs Added #![forbid(unsafe_code)]
openvmm/openvmm/src/main.rs Added #![forbid(unsafe_code)]
openhcl/underhill_threadpool/src/lib.rs Removed cfg_attr and moved #![cfg(target_os = "linux")] below module doc
openhcl/sidecar/src/main.rs Added unsafe_code expectation with comment to main.rs
openhcl/sidecar/src/arch/x86_64/mod.rs Removed duplicate unsafe_code expectation from arch module
openhcl/openvmm_hcl_resources/src/lib.rs Removed cfg_attr and moved #![cfg(target_os = "linux")] below module doc
openhcl/openvmm_hcl/src/main.rs Added #![forbid(unsafe_code)]
openhcl/ohcldiag-dev/src/main.rs Added #![forbid(unsafe_code)]
hyperv/tools/hypestv/src/main.rs Added #![forbid(unsafe_code)]
flowey/flowey_hvlite/src/main.rs Added #![forbid(unsafe_code)]

@smalis-msft smalis-msft requested a review from a team as a code owner October 21, 2025 19:38
@github-actions
Copy link

@smalis-msft smalis-msft enabled auto-merge (squash) October 22, 2025 17:06
@smalis-msft smalis-msft merged commit 9a4e9aa into microsoft:main Oct 22, 2025
54 checks passed
@smalis-msft smalis-msft deleted the attrs branch October 22, 2025 17:33
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