Skip to content

Commit 15541c9

Browse files
bonziniojeda
authored andcommitted
rust: macros: fix documentation of the paste! macro
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 <[email protected]> Reviewed-by: Alice Ryhl <[email protected]> Fixes: 823d473 ("rust: macros: add `paste!` proc macro") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Miguel Ojeda <[email protected]>
1 parent 8b55dc8 commit 15541c9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rust/macros/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ pub fn pinned_drop(args: TokenStream, input: TokenStream) -> TokenStream {
359359
/// macro_rules! pub_no_prefix {
360360
/// ($prefix:ident, $($newname:ident),+) => {
361361
/// kernel::macros::paste! {
362-
/// $(pub(crate) const fn [<$newname:lower:span>]: u32 = [<$prefix $newname:span>];)+
362+
/// $(pub(crate) const fn [<$newname:lower:span>]() -> u32 { [<$prefix $newname:span>] })+
363363
/// }
364364
/// };
365365
/// }

0 commit comments

Comments
 (0)