forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 396
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
Remove unneeded kernel::prelude::*
s from doctests
#1064
Labels
Comments
ojeda
added
• lib
Related to the `rust/` library.
good first issue
Good for newcomers
labels
Feb 18, 2024
I would love to work on this issue this week. |
Of course, please feel free to -- thanks! |
Instances of
|
A patch for this was submitted to the LKML :) |
ojeda
pushed a commit
to ojeda/linux
that referenced
this issue
May 5, 2024
Rust doctests implicitly include `kernel::prelude::*`. Removes explicit `kernel::prelude` imports from doctests. Suggested-by: Miguel Ojeda <ojeda@kernel.org> Link: Rust-for-Linux#1064 Signed-off-by: Nell Shamrell-Harrington <nells@linux.microsoft.com> Reviewed-by: Benno Lossin <benno.lossin@proton.me> Link: https://lore.kernel.org/r/20240411225331.274662-1-nells@linux.microsoft.com [ Add it back for `module_phy_driver`'s example since it is within a `mod`, and thus it cannot be removed. - Miguel ] Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
This is now in mainline: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=4a2ae8805129 Thanks again! |
Amazing! Ty for the opportunity! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In the kernel, Rust doctests implicitly include
kernel::prelude::*
. Thus remove it from all doctests from where it may make sense, and double-check they all still compile and pass by running them, e.g. under QEMU or with the KUnit script (see upcoming documentation about how to do so at https://lore.kernel.org/rust-for-linux/20240130075117.4137360-2-dirk.behme@de.bosch.com/).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 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://rust-for-linux.com/contributing for details.Please take this issue only if you are new to the kernel development process and you would like to use it as a test to submit your first patch to the kernel. Please do not take it if you do not plan to make other contributions to the kernel.
The text was updated successfully, but these errors were encountered: