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: miscellaneous synchronization with the user-space version

Remove the last differences between the kernel version and the
user-space version.

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

authored by

Benno Lossin and committed by
Miguel Ojeda
a9fa3a9c 7cb5dee4

+3 -6
+2 -3
rust/pin-init/internal/src/lib.rs
··· 14 14 // 15 15 // Remove once we have `proc_macro2` in the kernel. 16 16 #![allow(clippy::useless_conversion)] 17 + // Documentation is done in the pin-init crate instead. 18 + #![allow(missing_docs)] 17 19 18 20 use proc_macro::TokenStream; 19 21 ··· 32 30 mod pinned_drop; 33 31 mod zeroable; 34 32 35 - #[allow(missing_docs)] 36 33 #[proc_macro_attribute] 37 34 pub fn pin_data(inner: TokenStream, item: TokenStream) -> TokenStream { 38 35 pin_data::pin_data(inner.into(), item.into()).into() 39 36 } 40 37 41 - #[allow(missing_docs)] 42 38 #[proc_macro_attribute] 43 39 pub fn pinned_drop(args: TokenStream, input: TokenStream) -> TokenStream { 44 40 pinned_drop::pinned_drop(args.into(), input.into()).into() 45 41 } 46 42 47 - #[allow(missing_docs)] 48 43 #[proc_macro_derive(Zeroable)] 49 44 pub fn derive_zeroable(input: TokenStream) -> TokenStream { 50 45 zeroable::derive(input.into()).into()
+1 -1
rust/pin-init/src/__internal.rs
··· 14 14 /// 15 15 /// [nomicon]: https://doc.rust-lang.org/nomicon/subtyping.html 16 16 /// [this table]: https://doc.rust-lang.org/nomicon/phantom-data.html#table-of-phantomdata-patterns 17 - pub(super) type Invariant<T> = PhantomData<fn(*mut T) -> *mut T>; 17 + pub(crate) type Invariant<T> = PhantomData<fn(*mut T) -> *mut T>; 18 18 19 19 /// Module-internal type implementing `PinInit` and `Init`. 20 20 ///
-2
rust/pin-init/src/lib.rs
··· 349 349 /// } 350 350 /// } 351 351 /// ``` 352 - /// 353 - /// [`pin_init!`]: crate::pin_init 354 352 pub use ::pin_init_internal::pin_data; 355 353 356 354 /// Used to implement `PinnedDrop` safely.