diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2024-10-19 09:22:08 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-12-05 14:02:21 +0100 |
commit | 96ef0372fccf14cf819a83dfca2f49ca93f2c337 (patch) | |
tree | bc02059d7547b85370089f490e8c7f7408887748 | |
parent | b26e36b3e2cbca4d064f297b094c88d4879bdb06 (diff) |
rust: macros: fix documentation of the paste! macro
[ Upstream commit 15541c9263ce34ff95a06bc68f45d9bc5c990bcd ]
One of the example in this section uses a curious mix of the constant
and function declaration syntaxes; fix it.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Fixes: 823d4737d4c2 ("rust: macros: add `paste!` proc macro")
Link: https://lore.kernel.org/r/20241019072208.1016707-1-pbonzini@redhat.com
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | rust/macros/lib.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/rust/macros/lib.rs b/rust/macros/lib.rs index a626b1145e5c..90e2202ba4d5 100644 --- a/rust/macros/lib.rs +++ b/rust/macros/lib.rs @@ -359,7 +359,7 @@ pub fn pinned_drop(args: TokenStream, input: TokenStream) -> TokenStream { /// macro_rules! pub_no_prefix { /// ($prefix:ident, $($newname:ident),+) => { /// kernel::macros::paste! { -/// $(pub(crate) const fn [<$newname:lower:span>]: u32 = [<$prefix $newname:span>];)+ +/// $(pub(crate) const fn [<$newname:lower:span>]() -> u32 { [<$prefix $newname:span>] })+ /// } /// }; /// } |