Skip to content

Commit a9fa3a9

Browse files
y86-devojeda
authored andcommitted
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 <[email protected]> Reviewed-by: Andreas Hindborg <[email protected]> Tested-by: Andreas Hindborg <[email protected]> Reviewed-by: Fiona Behrens <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Miguel Ojeda <[email protected]>
1 parent 7cb5dee commit a9fa3a9

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

rust/pin-init/internal/src/lib.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
//
1515
// Remove once we have `proc_macro2` in the kernel.
1616
#![allow(clippy::useless_conversion)]
17+
// Documentation is done in the pin-init crate instead.
18+
#![allow(missing_docs)]
1719

1820
use proc_macro::TokenStream;
1921

@@ -30,19 +32,16 @@ mod pin_data;
3032
mod pinned_drop;
3133
mod zeroable;
3234

33-
#[allow(missing_docs)]
3435
#[proc_macro_attribute]
3536
pub fn pin_data(inner: TokenStream, item: TokenStream) -> TokenStream {
3637
pin_data::pin_data(inner.into(), item.into()).into()
3738
}
3839

39-
#[allow(missing_docs)]
4040
#[proc_macro_attribute]
4141
pub fn pinned_drop(args: TokenStream, input: TokenStream) -> TokenStream {
4242
pinned_drop::pinned_drop(args.into(), input.into()).into()
4343
}
4444

45-
#[allow(missing_docs)]
4645
#[proc_macro_derive(Zeroable)]
4746
pub fn derive_zeroable(input: TokenStream) -> TokenStream {
4847
zeroable::derive(input.into()).into()

rust/pin-init/src/__internal.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use super::*;
1414
///
1515
/// [nomicon]: https://doc.rust-lang.org/nomicon/subtyping.html
1616
/// [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>;
1818

1919
/// Module-internal type implementing `PinInit` and `Init`.
2020
///

rust/pin-init/src/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -349,8 +349,6 @@ pub use alloc::InPlaceInit;
349349
/// }
350350
/// }
351351
/// ```
352-
///
353-
/// [`pin_init!`]: crate::pin_init
354352
pub use ::pin_init_internal::pin_data;
355353

356354
/// Used to implement `PinnedDrop` safely.

0 commit comments

Comments
 (0)