mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
rust: init: disable doctests
The build system cannot handle doctests in the kernel crate in files outside of `rust/kernel/`. Subsequent commits will move files out of that directory, but will still compile them as part of the kernel crate. Thus ignore all doctests in the to-be-moved files. Leave tests disabled until they are separated into their own crate and they stop causing breakage. Signed-off-by: Benno Lossin <benno.lossin@proton.me> Reviewed-by: Fiona Behrens <me@kloenk.dev> Reviewed-by: Andreas Hindborg <a.hindborg@kernel.org> Tested-by: Andreas Hindborg <a.hindborg@kernel.org> Link: https://lore.kernel.org/r/20250308110339.2997091-2-benno.lossin@proton.me Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
This commit is contained in:
parent
dc60dd0c68
commit
206dea39e5
2 changed files with 24 additions and 24 deletions
|
@ -34,7 +34,7 @@
|
|||
//! [`pin_init!`]. The syntax is almost the same as normal `struct` initializers. The difference is
|
||||
//! that you need to write `<-` instead of `:` for fields that you want to initialize in-place.
|
||||
//!
|
||||
//! ```rust
|
||||
//! ```rust,ignore
|
||||
//! # #![expect(clippy::disallowed_names)]
|
||||
//! use kernel::sync::{new_mutex, Mutex};
|
||||
//! # use core::pin::Pin;
|
||||
|
@ -54,7 +54,7 @@
|
|||
//! `foo` now is of the type [`impl PinInit<Foo>`]. We can now use any smart pointer that we like
|
||||
//! (or just the stack) to actually initialize a `Foo`:
|
||||
//!
|
||||
//! ```rust
|
||||
//! ```rust,ignore
|
||||
//! # #![expect(clippy::disallowed_names)]
|
||||
//! # use kernel::sync::{new_mutex, Mutex};
|
||||
//! # use core::pin::Pin;
|
||||
|
@ -78,7 +78,7 @@
|
|||
//! Many types from the kernel supply a function/macro that returns an initializer, because the
|
||||
//! above method only works for types where you can access the fields.
|
||||
//!
|
||||
//! ```rust
|
||||
//! ```rust,ignore
|
||||
//! # use kernel::sync::{new_mutex, Arc, Mutex};
|
||||
//! let mtx: Result<Arc<Mutex<usize>>> =
|
||||
//! Arc::pin_init(new_mutex!(42, "example::mtx"), GFP_KERNEL);
|
||||
|
@ -86,7 +86,7 @@
|
|||
//!
|
||||
//! To declare an init macro/function you just return an [`impl PinInit<T, E>`]:
|
||||
//!
|
||||
//! ```rust
|
||||
//! ```rust,ignore
|
||||
//! # use kernel::{sync::Mutex, new_mutex, init::PinInit, try_pin_init};
|
||||
//! #[pin_data]
|
||||
//! struct DriverData {
|
||||
|
@ -119,7 +119,7 @@
|
|||
//! - you may assume that `slot` will stay pinned even after the closure returns until `drop` of
|
||||
//! `slot` gets called.
|
||||
//!
|
||||
//! ```rust
|
||||
//! ```rust,ignore
|
||||
//! # #![expect(unreachable_pub, clippy::disallowed_names)]
|
||||
//! use kernel::{init, types::Opaque};
|
||||
//! use core::{ptr::addr_of_mut, marker::PhantomPinned, pin::Pin};
|
||||
|
@ -236,7 +236,7 @@ pub mod macros;
|
|||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,ignore
|
||||
/// # #![expect(clippy::disallowed_names)]
|
||||
/// # use kernel::{init, macros::pin_data, pin_init, stack_pin_init, init::*, sync::Mutex, new_mutex};
|
||||
/// # use core::pin::Pin;
|
||||
|
@ -382,7 +382,7 @@ macro_rules! stack_try_pin_init {
|
|||
///
|
||||
/// The syntax is almost identical to that of a normal `struct` initializer:
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,ignore
|
||||
/// # use kernel::{init, pin_init, macros::pin_data, init::*};
|
||||
/// # use core::pin::Pin;
|
||||
/// #[pin_data]
|
||||
|
@ -426,7 +426,7 @@ macro_rules! stack_try_pin_init {
|
|||
///
|
||||
/// To create an initializer function, simply declare it like this:
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,ignore
|
||||
/// # use kernel::{init, pin_init, init::*};
|
||||
/// # use core::pin::Pin;
|
||||
/// # #[pin_data]
|
||||
|
@ -452,7 +452,7 @@ macro_rules! stack_try_pin_init {
|
|||
///
|
||||
/// Users of `Foo` can now create it like this:
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,ignore
|
||||
/// # #![expect(clippy::disallowed_names)]
|
||||
/// # use kernel::{init, pin_init, macros::pin_data, init::*};
|
||||
/// # use core::pin::Pin;
|
||||
|
@ -480,7 +480,7 @@ macro_rules! stack_try_pin_init {
|
|||
///
|
||||
/// They can also easily embed it into their own `struct`s:
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,ignore
|
||||
/// # use kernel::{init, pin_init, macros::pin_data, init::*};
|
||||
/// # use core::pin::Pin;
|
||||
/// # #[pin_data]
|
||||
|
@ -539,7 +539,7 @@ macro_rules! stack_try_pin_init {
|
|||
///
|
||||
/// For instance:
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,ignore
|
||||
/// # use kernel::{macros::{Zeroable, pin_data}, pin_init};
|
||||
/// # use core::{ptr::addr_of_mut, marker::PhantomPinned};
|
||||
/// #[pin_data]
|
||||
|
@ -602,7 +602,7 @@ macro_rules! pin_init {
|
|||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,ignore
|
||||
/// use kernel::{init::{self, PinInit}, error::Error};
|
||||
/// #[pin_data]
|
||||
/// struct BigBuf {
|
||||
|
@ -705,7 +705,7 @@ macro_rules! init {
|
|||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,ignore
|
||||
/// use kernel::{alloc::KBox, init::{PinInit, zeroed}, error::Error};
|
||||
/// struct BigBuf {
|
||||
/// big: KBox<[u8; 1024 * 1024 * 1024]>,
|
||||
|
@ -761,7 +761,7 @@ macro_rules! try_init {
|
|||
/// # Example
|
||||
///
|
||||
/// This will succeed:
|
||||
/// ```
|
||||
/// ```ignore
|
||||
/// use kernel::assert_pinned;
|
||||
/// #[pin_data]
|
||||
/// struct MyStruct {
|
||||
|
@ -787,7 +787,7 @@ macro_rules! try_init {
|
|||
/// Some uses of the macro may trigger the `can't use generic parameters from outer item` error. To
|
||||
/// work around this, you may pass the `inline` parameter to the macro. The `inline` parameter can
|
||||
/// only be used when the macro is invoked from a function body.
|
||||
/// ```
|
||||
/// ```ignore
|
||||
/// use kernel::assert_pinned;
|
||||
/// #[pin_data]
|
||||
/// struct Foo<T> {
|
||||
|
@ -865,7 +865,7 @@ pub unsafe trait PinInit<T: ?Sized, E = Infallible>: Sized {
|
|||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,ignore
|
||||
/// # #![expect(clippy::disallowed_names)]
|
||||
/// use kernel::{types::Opaque, init::pin_init_from_closure};
|
||||
/// #[repr(C)]
|
||||
|
@ -977,7 +977,7 @@ pub unsafe trait Init<T: ?Sized, E = Infallible>: PinInit<T, E> {
|
|||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,ignore
|
||||
/// # #![expect(clippy::disallowed_names)]
|
||||
/// use kernel::{types::Opaque, init::{self, init_from_closure}};
|
||||
/// struct Foo {
|
||||
|
@ -1089,7 +1089,7 @@ pub fn uninit<T, E>() -> impl Init<MaybeUninit<T>, E> {
|
|||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,ignore
|
||||
/// use kernel::{alloc::KBox, error::Error, init::init_array_from_fn};
|
||||
/// let array: KBox<[usize; 1_000]> =
|
||||
/// KBox::init::<Error>(init_array_from_fn(|i| i), GFP_KERNEL)?;
|
||||
|
@ -1134,7 +1134,7 @@ where
|
|||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,ignore
|
||||
/// use kernel::{sync::{Arc, Mutex}, init::pin_init_array_from_fn, new_mutex};
|
||||
/// let array: Arc<[Mutex<usize>; 1_000]> =
|
||||
/// Arc::pin_init(pin_init_array_from_fn(|i| new_mutex!(i)), GFP_KERNEL)?;
|
||||
|
@ -1323,7 +1323,7 @@ impl<T> InPlaceWrite<T> for UniqueArc<MaybeUninit<T>> {
|
|||
///
|
||||
/// Use [`pinned_drop`] to implement this trait safely:
|
||||
///
|
||||
/// ```rust
|
||||
/// ```rust,ignore
|
||||
/// # use kernel::sync::Mutex;
|
||||
/// use kernel::macros::pinned_drop;
|
||||
/// use core::pin::Pin;
|
||||
|
|
|
@ -272,7 +272,7 @@ pub fn concat_idents(ts: TokenStream) -> TokenStream {
|
|||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// ```ignore
|
||||
/// # #![feature(lint_reasons)]
|
||||
/// # use kernel::prelude::*;
|
||||
/// # use std::{sync::Mutex, process::Command};
|
||||
|
@ -285,7 +285,7 @@ pub fn concat_idents(ts: TokenStream) -> TokenStream {
|
|||
/// }
|
||||
/// ```
|
||||
///
|
||||
/// ```
|
||||
/// ```ignore
|
||||
/// # #![feature(lint_reasons)]
|
||||
/// # use kernel::prelude::*;
|
||||
/// # use std::{sync::Mutex, process::Command};
|
||||
|
@ -326,7 +326,7 @@ pub fn pin_data(inner: TokenStream, item: TokenStream) -> TokenStream {
|
|||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// ```ignore
|
||||
/// # #![feature(lint_reasons)]
|
||||
/// # use kernel::prelude::*;
|
||||
/// # use macros::{pin_data, pinned_drop};
|
||||
|
@ -502,7 +502,7 @@ pub fn paste(input: TokenStream) -> TokenStream {
|
|||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// ```ignore
|
||||
/// use kernel::macros::Zeroable;
|
||||
///
|
||||
/// #[derive(Zeroable)]
|
||||
|
|
Loading…
Add table
Reference in a new issue