Skip to content

Align DropGuard API with upstream Rust #1255

Description

@nbdd0121

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomersmediumExpected to be an issue of medium difficulty to resolve.• libRelated to the `rust/` library.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions