File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ There are also language features that provide a level of control over panic beha
1616> [ !NOTE]
1717> The standard library provides the capability to explicitly panic via the [ ` panic! ` macro] [ panic! ] .
1818
19+ <!-- template:attributes -->
1920r[ panic.panic_handler]
2021## The ` panic_handler ` attribute
2122
@@ -59,16 +60,16 @@ The *`panic_handler` [attribute][attributes]* can be applied to a function to de
5960> The [`PanicInfo`] struct contains information about the location of the panic.
6061
6162r[panic.panic_handler.syntax]
62- The `panic_handler` attribute uses the [MetaWord] syntax and thus does not take any inputs .
63+ The `panic_handler` attribute uses the [MetaWord] syntax.
6364
6465r[panic.panic_handler.allowed-positions]
6566The `panic_handler` attribute may only be applied to a function with signature `fn(&PanicInfo) -> !`.
6667
6768r[panic.panic_handler.duplicates]
68- Duplicate instances of the `panic_handler` attribute on a function are ignored .
69+ The `panic_handler` attribute may be used any number of times on a function.
6970
7071> [!NOTE]
71- > `rustc` currently warns about unused duplicate `panic_handler` attributes .
72+ > `rustc` lints against any use following the first .
7273
7374r[panic.panic_handler.unique]
7475There must be a single `panic_handler` function in the dependency graph.
You can’t perform that action at this time.
0 commit comments