Skip to content

Commit

Permalink
Merge pull request #263 from joshtriplett/c-dtor-clarify
Browse files Browse the repository at this point in the history
C-DTOR: Clarify that `Drop` should ignore errors
  • Loading branch information
dtolnay authored Jun 12, 2022
2 parents b6c506d + c8bb675 commit 8486acc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/dependability.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ destructor causes the program to abort.

Instead of failing in a destructor, provide a separate method for checking for
clean teardown, e.g. a `close` method, that returns a `Result` to signal
problems.
problems. If that `close` method is not called, the `Drop` implementation
should do the teardown and ignore or log/trace any errors it produces.


<a id="c-dtor-block"></a>
Expand Down

0 comments on commit 8486acc

Please sign in to comment.