The upstream Rust DropGuard API will be stabilized: rust-lang/rust#161520
Currently our kernel::types::ScopeGuard API is slightly different with the to-be-stable version. We should create a new type kernel::mem::DropGuard which matches the upstream API and implementation, and migrate the users over. This would allow us to replace it with pub 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::mem exists 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 a Link: tag to this issue. Please see https://docs.kernel.org/process/submitting-patches.html and https://rust-for-linux.com/contributing for details.
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.