-
Notifications
You must be signed in to change notification settings - Fork 73
feat: update edition to 2024 #543
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 updates the Rust edition from 2021 to 2024 across the workspace, implementing all necessary code changes to comply with the new edition's stricter safety requirements and modern language features.
Key Changes:
- Updated edition to 2024 in workspace Cargo.toml
- Wrapped all unsafe operations in explicit
unsafeblocks as required by edition 2024 - Standardized safety documentation comments to use uppercase
SAFETY: - Adopted let-chain syntax (
if let ... && let ...) replacing nested if-let patterns - Added explicit capture syntax (
+ use<T>) to impl trait return types - Removed redundant
ref mutpatterns in match expressions
Reviewed changes
Copilot reviewed 48 out of 48 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| Cargo.toml | Updated workspace edition from "2021" to "2024" |
| compio/tests/runtime.rs | Wrapped unsafe method calls in explicit unsafe blocks |
| compio-runtime/tests/custom_loop.rs | Added unsafe block for KillTimer call |
| compio-runtime/src/runtime/send_wrapper.rs | Standardized SAFETY comment style |
| compio-runtime/src/runtime/mod.rs | Added + use<T> bounds to impl Future return types |
| compio-runtime/src/runtime/buffer_pool.rs | Updated SAFETY comment style |
| compio-runtime/src/attacher.rs | Added unsafe blocks and enhanced safety documentation |
| compio-quic/src/socket.rs | Refactored to use let-chain syntax |
| compio-quic/src/endpoint.rs | Simplified ManuallyDrop usage pattern |
| compio-process/src/lib.rs | Wrapped pre_exec call in unsafe block |
| compio-net/src/udp.rs | Wrapped socket option calls in unsafe blocks |
| compio-net/src/socket.rs | Wrapped assume_init calls in unsafe blocks |
| compio-net/src/resolve/windows.rs | Added unsafe blocks and let-chain syntax |
| compio-net/src/cmsg/windows.rs | Wrapped all unsafe operations in explicit blocks |
| compio-net/src/cmsg/unix.rs | Wrapped unsafe libc calls in explicit blocks |
| compio-net/src/cmsg/mod.rs | Wrapped data() call in unsafe block |
| compio-macros/src/item_fn.rs | Adopted let-chain syntax |
| compio-io/src/read/ext.rs | Updated SAFETY comment style |
| compio-io/src/compat/async_stream.rs | Updated SAFETY comment style |
| compio-io/src/buffer.rs | Wrapped set_buf_init call in unsafe block |
| compio-fs/src/stdio/windows.rs | Wrapped get_unchecked_mut and updated SAFETY comments |
| compio-fs/src/named_pipe.rs | Updated SAFETY comment style |
| compio-fs/src/async_fd.rs | Enhanced safety documentation and wrapped unsafe calls |
| compio-driver/src/unix/op.rs | Wrapped io_slices and io_slices_mut calls in unsafe blocks |
| compio-driver/src/stub/mod.rs | Removed unsafe qualifier from poll method signature |
| compio-driver/src/poll/op.rs | Updated SAFETY comments and wrapped unsafe operations |
| compio-driver/src/poll/mod.rs | Adopted let-chain syntax and wrapped unsafe operations |
| compio-driver/src/op.rs | Updated SAFETY comment style |
| compio-driver/src/lib.rs | Wrapped FromRawFd/Handle/Socket implementations and updated comments |
| compio-driver/src/key.rs | Wrapped unsafe operations in explicit blocks |
| compio-driver/src/iour/op.rs | Updated SAFETY comments and enhanced documentation |
| compio-driver/src/iour/mod.rs | Removed unsafe qualifier from poll and wrapped unsafe call |
| compio-driver/src/iocp/wait/thread_pool.rs | Added SAFETY comment and unsafe block |
| compio-driver/src/iocp/op.rs | Wrapped all Windows API calls in unsafe blocks with SAFETY comments |
| compio-driver/src/iocp/mod.rs | Adopted let-chain syntax and removed unsafe from poll signature |
| compio-driver/src/iocp/cp/mod.rs | Adopted let-chain syntax for cleaner conditional logic |
| compio-driver/src/fusion/op.rs | Removed redundant ref mut patterns from match expressions |
| compio-driver/src/fusion/mod.rs | Removed unsafe from poll signature and wrapped release_buffer_pool |
| compio-driver/src/fd/mod.rs | Simplified ManuallyDrop pattern and wrapped unsafe operations |
| compio-driver/src/buffer_pool/iour.rs | Wrapped get_buf calls and updated SAFETY comments |
| compio-driver/src/buffer_pool/fallback.rs | Updated SAFETY comments throughout |
| compio-driver/src/asyncify.rs | Updated SAFETY comment style |
| compio-buf/src/uninit.rs | Wrapped set_buf_init call in unsafe block |
| compio-buf/src/slice.rs | Wrapped iter_io_buffer calls and pointer arithmetic in unsafe blocks |
| compio-buf/src/io_vec_buf.rs | Wrapped all iter_io_buffer and set_buf_init calls |
| compio-buf/src/io_slice.rs | Enhanced safety documentation for from_slice methods |
| compio-buf/src/io_buf.rs | Enhanced SetBufInit documentation and wrapped all unsafe operations |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
AsakuraMizu
left a comment
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.
Does this PR need to be reviewed file by file?
|
Check the summary from copilot if you want to review quickly? |
George-Miao
left a comment
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.
LGTM
Closes #541