-
Notifications
You must be signed in to change notification settings - Fork 161
Repo: cleanup some attributes #2230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 redundantcfg_attrpatterns) - 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)] |
Remove some unneeded attributes, move some around, tweak some to be cleaner, add some more forbid(unsafe_code)s.