Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rust: pin-init: fix documentation links

Before switching to compile the `pin-init` crate directly, change
any links that would be invalid to links that are valid both before and
after the switch.

Signed-off-by: Benno Lossin <benno.lossin@proton.me>
Reviewed-by: Fiona Behrens <me@kloenk.dev>
Tested-by: Andreas Hindborg <a.hindborg@kernel.org>
Link: https://lore.kernel.org/r/20250308110339.2997091-12-benno.lossin@proton.me
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>

authored by

Benno Lossin and committed by
Miguel Ojeda
129e97be 5657c3a9

+14 -11
+1 -1
rust/kernel/sync/condvar.rs
··· 37 37 /// spuriously. 38 38 /// 39 39 /// Instances of [`CondVar`] need a lock class and to be pinned. The recommended way to create such 40 - /// instances is with the [`pin_init`](crate::pin_init) and [`new_condvar`] macros. 40 + /// instances is with the [`pin_init`](crate::pin_init!) and [`new_condvar`] macros. 41 41 /// 42 42 /// # Examples 43 43 ///
+2 -2
rust/pin-init/src/__internal.rs
··· 135 135 /// 136 136 /// If `self.is_init` is true, then `self.value` is initialized. 137 137 /// 138 - /// [`stack_pin_init`]: kernel::stack_pin_init 138 + /// [`stack_pin_init`]: crate::stack_pin_init 139 139 pub struct StackInit<T> { 140 140 value: MaybeUninit<T>, 141 141 is_init: bool, ··· 156 156 /// Creates a new [`StackInit<T>`] that is uninitialized. Use [`stack_pin_init`] instead of this 157 157 /// primitive. 158 158 /// 159 - /// [`stack_pin_init`]: kernel::stack_pin_init 159 + /// [`stack_pin_init`]: crate::stack_pin_init 160 160 #[inline] 161 161 pub fn uninit() -> Self { 162 162 Self {
+11 -8
rust/pin-init/src/lib.rs
··· 10 10 //! To initialize a `struct` with an in-place constructor you will need two things: 11 11 //! - an in-place constructor, 12 12 //! - a memory location that can hold your `struct` (this can be the [stack], an [`Arc<T>`], 13 - //! [`KBox<T>`] or any other smart pointer that supports this library). 13 + //! [`Box<T>`] or any other smart pointer that supports this library). 14 14 //! 15 15 //! To get an in-place constructor there are generally three options: 16 16 //! - directly creating an in-place constructor using the [`pin_init!`] macro, ··· 204 204 //! [structurally pinned fields]: 205 205 //! https://doc.rust-lang.org/std/pin/index.html#pinning-is-structural-for-field 206 206 //! [stack]: crate::stack_pin_init 207 - //! [`Arc<T>`]: crate::sync::Arc 207 + //! [`Arc<T>`]: https://rust.docs.kernel.org/kernel/sync/struct.Arc.html 208 + //! [`Box<T>`]: https://rust.docs.kernel.org/kernel/alloc/kbox/struct.Box.html 208 209 //! [`impl PinInit<Foo>`]: PinInit 209 210 //! [`impl PinInit<T, E>`]: PinInit 210 211 //! [`impl Init<T, E>`]: Init ··· 662 661 /// }); 663 662 /// ``` 664 663 /// 665 - /// [`try_pin_init!`]: kernel::try_pin_init 664 + /// [`try_pin_init!`]: crate::try_pin_init 666 665 /// [`NonNull<Self>`]: core::ptr::NonNull 667 666 // For a detailed example of how this macro works, see the module documentation of the hidden 668 667 // module `__internal` inside of `init/__internal.rs`. ··· 886 885 /// A pin-initializer for the type `T`. 887 886 /// 888 887 /// To use this initializer, you will need a suitable memory location that can hold a `T`. This can 889 - /// be [`KBox<T>`], [`Arc<T>`] or even the stack (see [`stack_pin_init!`]). 888 + /// be [`Box<T>`], [`Arc<T>`] or even the stack (see [`stack_pin_init!`]). 890 889 /// 891 890 /// Also see the [module description](self). 892 891 /// ··· 903 902 /// - `slot` is not partially initialized. 904 903 /// - while constructing the `T` at `slot` it upholds the pinning invariants of `T`. 905 904 /// 906 - /// [`Arc<T>`]: crate::sync::Arc 905 + /// [`Arc<T>`]: https://rust.docs.kernel.org/kernel/sync/struct.Arc.html 906 + /// [`Box<T>`]: https://rust.docs.kernel.org/kernel/alloc/kbox/struct.Box.html 907 907 #[must_use = "An initializer must be used in order to create its value."] 908 908 pub unsafe trait PinInit<T: ?Sized, E = Infallible>: Sized { 909 909 /// Initializes `slot`. ··· 970 968 /// An initializer for `T`. 971 969 /// 972 970 /// To use this initializer, you will need a suitable memory location that can hold a `T`. This can 973 - /// be [`KBox<T>`], [`Arc<T>`] or even the stack (see [`stack_pin_init!`]). Because 971 + /// be [`Box<T>`], [`Arc<T>`] or even the stack (see [`stack_pin_init!`]). Because 974 972 /// [`PinInit<T, E>`] is a super trait, you can use every function that takes it as well. 975 973 /// 976 974 /// Also see the [module description](self). ··· 994 992 /// Contrary to its supertype [`PinInit<T, E>`] the caller is allowed to 995 993 /// move the pointee after initialization. 996 994 /// 997 - /// [`Arc<T>`]: crate::sync::Arc 995 + /// [`Arc<T>`]: https://rust.docs.kernel.org/kernel/sync/struct.Arc.html 996 + /// [`Box<T>`]: https://rust.docs.kernel.org/kernel/alloc/kbox/struct.Box.html 998 997 #[must_use = "An initializer must be used in order to create its value."] 999 998 pub unsafe trait Init<T: ?Sized, E = Infallible>: PinInit<T, E> { 1000 999 /// Initializes `slot`. ··· 1275 1272 /// 1276 1273 /// This trait must be implemented via the [`pinned_drop`] proc-macro attribute on the impl. 1277 1274 /// 1278 - /// [`pinned_drop`]: kernel::macros::pinned_drop 1275 + /// [`pinned_drop`]: crate::macros::pinned_drop 1279 1276 pub unsafe trait PinnedDrop: __internal::HasPinData { 1280 1277 /// Executes the pinned destructor of this type. 1281 1278 ///