Skip to content

Commit d8e8071

Browse files
committed
Minor update of panic_hanlder
More closely align with the template, and some minor word tweaks.
1 parent 731d62a commit d8e8071

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/panic.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff 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 -->
1920
r[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
6162
r[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
6465
r[panic.panic_handler.allowed-positions]
6566
The `panic_handler` attribute may only be applied to a function with signature `fn(&PanicInfo) -> !`.
6667
6768
r[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
7374
r[panic.panic_handler.unique]
7475
There must be a single `panic_handler` function in the dependency graph.

0 commit comments

Comments
 (0)