mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-04 20:19:47 +08:00

Rename relative paths inside of the crate to still refer to the same items, also rename paths inside of the kernel crate and adjust the build system to build the crate. [ Remove the `expect` (and thus the `lint_reasons` feature) since the tree now uses `quote!` from `rust/macros/export.rs`. Remove the `TokenStream` import removal, since it is now used as well. In addition, temporarily (i.e. just for this commit) use an `--extern force:alloc` to prevent an unknown `new_uninit` error in the `rustdoc` target. For context, please see a similar case in: https://lore.kernel.org/lkml/20240422090644.525520-1-ojeda@kernel.org/ And adjusted the message above. - Miguel ] 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-16-benno.lossin@proton.me Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
40 lines
1015 B
Rust
40 lines
1015 B
Rust
// SPDX-License-Identifier: Apache-2.0 OR MIT
|
|
|
|
// When fixdep scans this, it will find this string `CONFIG_RUSTC_VERSION_TEXT`
|
|
// and thus add a dependency on `include/config/RUSTC_VERSION_TEXT`, which is
|
|
// touched by Kconfig when the version string from the compiler changes.
|
|
|
|
//! `pin-init` proc macros.
|
|
|
|
#![cfg_attr(not(RUSTC_LINT_REASONS_IS_STABLE), feature(lint_reasons))]
|
|
|
|
use proc_macro::TokenStream;
|
|
|
|
#[cfg(kernel)]
|
|
#[path = "../../../macros/quote.rs"]
|
|
#[macro_use]
|
|
mod quote;
|
|
|
|
mod helpers;
|
|
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, item)
|
|
}
|
|
|
|
#[allow(missing_docs)]
|
|
#[proc_macro_attribute]
|
|
pub fn pinned_drop(args: TokenStream, input: TokenStream) -> TokenStream {
|
|
pinned_drop::pinned_drop(args, input)
|
|
}
|
|
|
|
#[allow(missing_docs)]
|
|
#[proc_macro_derive(Zeroable)]
|
|
pub fn derive_zeroable(input: TokenStream) -> TokenStream {
|
|
zeroable::derive(input)
|
|
}
|