diff options
Diffstat (limited to 'rust/kernel/init.rs')
-rw-r--r-- | rust/kernel/init.rs | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/rust/kernel/init.rs b/rust/kernel/init.rs index 7fd1ea8265a5..aa8df0595585 100644 --- a/rust/kernel/init.rs +++ b/rust/kernel/init.rs @@ -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; |