From: Paolo Bonzini Date: Sat, 19 Oct 2024 07:22:08 +0000 (+0200) Subject: rust: macros: fix documentation of the paste! macro X-Git-Tag: v6.11.11~318 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c2b0d5a281d9e15b9ab28dac5c3ad74bfd4e9960;p=thirdparty%2Fkernel%2Fstable.git 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 Reviewed-by: Alice Ryhl 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 Signed-off-by: Sasha Levin --- diff --git a/rust/macros/lib.rs b/rust/macros/lib.rs index 5be0cb9db3ee4..8a2ed9472bb08 100644 --- a/rust/macros/lib.rs +++ b/rust/macros/lib.rs @@ -355,7 +355,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>] })+ /// } /// }; /// }