forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 495
Align DropGuard API with upstream Rust #1255
Copy link
Copy link
Open
Labels
good first issueGood for newcomersGood for newcomersmediumExpected to be an issue of medium difficulty to resolve.Expected to be an issue of medium difficulty to resolve.• libRelated to the `rust/` library.Related to the `rust/` library.
Description
Activity
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomersmediumExpected to be an issue of medium difficulty to resolve.Expected to be an issue of medium difficulty to resolve.• libRelated to the `rust/` library.Related to the `rust/` library.
The upstream Rust
DropGuardAPI will be stabilized: rust-lang/rust#161520Currently our
kernel::types::ScopeGuardAPI is slightly different with the to-be-stable version. We should create a new typekernel::mem::DropGuardwhich matches the upstream API and implementation, and migrate the users over. This would allow us to replace it withpub use core::mem::DropGuard;when our MSRV is bumped high enough.This requires introducing the new type, convert users, and then remove the old API, likely over multiple kernel release cycles (thus marking the issue as medium difficulty).
NOTE:
kernel::memexists in linux-next but not yet in rust-next, so you should choose target branch carefully. Please do not work on this task until the linked upstream PR is merged.This requires submitting a proper patch to the LKML and the Rust for Linux mailing list. Please recall to test your changes (including generating the documentation if changed, running the Rust doctests if changed, etc.), to justify the commit well in the message ("what" & "why"), to use a proper title for the commit, to sign your commit under the Developer's Certificate of Origin and to add a
Suggested-by:tag, and aLink:tag to this issue. Please see https://docs.kernel.org/process/submitting-patches.html and https://rust-for-linux.com/contributing for details.