Skip to content

Conversation

@Berrysoft
Copy link
Member

Closes #541

@Berrysoft Berrysoft added this to the v0.17 milestone Nov 24, 2025
@Berrysoft Berrysoft self-assigned this Nov 24, 2025
@Berrysoft Berrysoft added enhancement New feature or request refactor Refactoring existing code labels Nov 24, 2025
Copilot finished reviewing on behalf of Berrysoft November 24, 2025 15:43
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 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 unsafe blocks 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 mut patterns 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.

Copy link
Collaborator

@AsakuraMizu AsakuraMizu left a 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?

@Berrysoft
Copy link
Member Author

Check the summary from copilot if you want to review quickly?

Copy link
Member

@George-Miao George-Miao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@George-Miao George-Miao merged commit c013e32 into compio-rs:master Nov 27, 2025
53 checks passed
@Berrysoft Berrysoft deleted the dev/update-edition branch November 27, 2025 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request refactor Refactoring existing code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update to edition 2024

3 participants