summaryrefslogtreecommitdiff
path: root/rust
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2024-10-19 09:22:08 +0200
committerMiguel Ojeda <ojeda@kernel.org>2024-10-21 20:35:53 +0200
commit15541c9263ce34ff95a06bc68f45d9bc5c990bcd (patch)
tree47751a91ccfb5984bf1bd74f791fcc30abfc01e0 /rust
parent8b55dc8610acf816a66373be53ca6e3bbe2d313a (diff)
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 <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>
Diffstat (limited to 'rust')
-rw-r--r--rust/macros/lib.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/rust/macros/lib.rs b/rust/macros/lib.rs
index 8d4ac914b48b..939ae00b723a 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>] })+
/// }
/// };
/// }