Skip to content

Commit f97e06f

Browse files
committed
docs: rust: clarify panicking
Link: https://lore.kernel.org/lkml/CAKwvOdmXNAm+TcypR0dCayp9bJ7RFcgLx5sB8_2MfzO31T3PJg@mail.gmail.com/ Suggested-by: Nick Desaulniers <[email protected]> Signed-off-by: Miguel Ojeda <[email protected]>
1 parent 0a4d8cd commit f97e06f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Documentation/rust/docs.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ This example showcases a few ``rustdoc`` features and some common conventions
8787
safe under a ``Safety`` section.
8888

8989
* While not shown here, if a function may panic, the conditions under which
90-
that happens must be described under a ``Panics`` section.
90+
that happens must be described under a ``Panics`` section. Please note that
91+
panicking should be very rare and used only with a good reason. In almost
92+
all cases, you should use a fallible approach, returning a `Result`.
9193

9294
* If providing examples of usage would help readers, they must be written in
9395
a section called ``Examples``.

0 commit comments

Comments
 (0)