From 7e9c77641a3dfb5df7c2218081ee625d0d069f4b Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Fri, 29 May 2026 17:34:59 +0800 Subject: Support doc comments and attributes on `pack!` and `dispatcher!` macros --- CHANGELOG.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'CHANGELOG.md') diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f4f7da..b598d1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -87,6 +87,40 @@ dispatcher!("remote.add" /*, CMDRemoteAdd => EntryRemoteAdd */); dispatcher!("remote.remove", CMDRemoteRemove => EntryRemoteRemove); ``` +8. **\[macros\]** The `pack!` macro now supports adding doc comments and attributes (e.g., `#[doc(hidden)]`) to the inner structs: + +```rust +pack!{ + /// Your comment + StateGreet = String +} + +pack! { + #[doc(hidden)] + ThisProgram, InternalErrorNoName = () +} +``` + +9. **[macros]** The `dispatcher!` macro now supports adding doc comments and attributes (e.g., `#[doc(hidden)]`) to both the dispatcher and entry structs, similar to the `pack!` macro: + +```rust +// Implicit +dispatcher! { + /// Comment for dispatcher + "todo.add", CMDTodoAdd => + /// Comment for entry + EntryTodoAdd +} + +// Explicit +dispatcher! { + /// Comment for dispatcher + ThisProgram, "todo.add", CMDTodoAdd => + /// Comment for entry + EntryTodoAdd +} +``` + #### **BREAKING CHANGES** (API CHANGES): 1. **\[core\]** Panic Unwind will not be supported when the `async` feature is enabled -- cgit