mirror of
https://github.com/torvalds/linux.git
synced 2025-04-06 00:16:18 +00:00
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>
This commit is contained in:
parent
7cb5dee4c8
commit
a9fa3a9c6e
@ -14,6 +14,8 @@
|
||||
//
|
||||
// Remove once we have `proc_macro2` in the kernel.
|
||||
#![allow(clippy::useless_conversion)]
|
||||
// Documentation is done in the pin-init crate instead.
|
||||
#![allow(missing_docs)]
|
||||
|
||||
use proc_macro::TokenStream;
|
||||
|
||||
@ -30,19 +32,16 @@ mod pin_data;
|
||||
mod pinned_drop;
|
||||
mod zeroable;
|
||||
|
||||
#[allow(missing_docs)]
|
||||
#[proc_macro_attribute]
|
||||
pub fn pin_data(inner: TokenStream, item: TokenStream) -> TokenStream {
|
||||
pin_data::pin_data(inner.into(), item.into()).into()
|
||||
}
|
||||
|
||||
#[allow(missing_docs)]
|
||||
#[proc_macro_attribute]
|
||||
pub fn pinned_drop(args: TokenStream, input: TokenStream) -> TokenStream {
|
||||
pinned_drop::pinned_drop(args.into(), input.into()).into()
|
||||
}
|
||||
|
||||
#[allow(missing_docs)]
|
||||
#[proc_macro_derive(Zeroable)]
|
||||
pub fn derive_zeroable(input: TokenStream) -> TokenStream {
|
||||
zeroable::derive(input.into()).into()
|
||||
|
@ -14,7 +14,7 @@ use super::*;
|
||||
///
|
||||
/// [nomicon]: https://doc.rust-lang.org/nomicon/subtyping.html
|
||||
/// [this table]: https://doc.rust-lang.org/nomicon/phantom-data.html#table-of-phantomdata-patterns
|
||||
pub(super) type Invariant<T> = PhantomData<fn(*mut T) -> *mut T>;
|
||||
pub(crate) type Invariant<T> = PhantomData<fn(*mut T) -> *mut T>;
|
||||
|
||||
/// Module-internal type implementing `PinInit` and `Init`.
|
||||
///
|
||||
|
@ -349,8 +349,6 @@ pub use alloc::InPlaceInit;
|
||||
/// }
|
||||
/// }
|
||||
/// ```
|
||||
///
|
||||
/// [`pin_init!`]: crate::pin_init
|
||||
pub use ::pin_init_internal::pin_data;
|
||||
|
||||
/// Used to implement `PinnedDrop` safely.
|
||||
|
Loading…
x
Reference in New Issue
Block a user