doc: AssertUnreachable and NONFATAL_UNREACHABLE #36952

Manually merged
maflcko merged 1 commit from 2611-doc-Unreachable into master 2026-12-02 13:55:18 +00:00 AGit
maflcko commented 2026-11-23 14:02:43 +00:00 (Migrated from github.com)
  • Move the "Assertions and Checks" section from "tips and tricks" (building and debugging) to "guidelines" (coding). (Can be reviewed via --color-moved=dimmed-zebra)
  • Add missing point on AssertUnreachable and NONFATAL_UNREACHABLE to the dev notes.
* Move the "Assertions and Checks" section from "tips and tricks" (building and debugging) to "guidelines" (coding). (Can be reviewed via `--color-moved=dimmed-zebra`) * Add missing point on `AssertUnreachable` and `NONFATAL_UNREACHABLE` to the dev notes.
DrahtBot commented 2026-11-23 14:02:52 +00:00 (Migrated from github.com)

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

External sites

Reviews

See the guideline and AI policy for information on the review process.

Type Reviewers
ACK hodlinator, optout21, l0rinc

If your review is incorrectly listed, please copy-paste <!--meta-tag:bot-skip--> into the comment that the bot should ignore.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #36900 (doc: document how to reference killed mutant by brunoerg)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

<!--e57a25ab6845829454e8d69fc972939a--> The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. <!--006a51241073e994b41acfe9ec718e94--> ### External sites * Code coverage & benchmarks: https://corecheck.dev/bitcoin/bitcoin/pulls/36952 * Ralph review <img src=https://review.fish.foo/assets/bitcoin/bitcoin/36952.png alt="Ralph review status"> https://git.fish.foo/bitcoin/bitcoin/pulls/36952#author-ralph <!--021abf342d371248e50ceaed478a90ca--> ### Reviews See [the guideline](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#code-review) and [AI policy](https://github.com/bitcoin/bitcoin/blob/master/doc/AI_POLICY.md) for information on the review process. | Type | Reviewers | | ---- | --------- | | ACK | [hodlinator](https://github.com/bitcoin/bitcoin/pull/36952#pullrequestreview-6036825641), [optout21](https://github.com/bitcoin/bitcoin/pull/36952#issuecomment-7312608152), [l0rinc](https://github.com/bitcoin/bitcoin/pull/36952#issuecomment-7347576203) | If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore. <!--174a7506f384e20aa4161008e828411d--> ### Conflicts Reviewers, this pull request conflicts with the following ones: * [#36900](https://github.com/bitcoin/bitcoin/pull/36900) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36900.svg"></sub> (doc: document how to reference killed mutant by brunoerg) If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. <!--5faf32d7da4f0f540f40219e4f7537a3-->
First-time contributor

No verified findings are available from this review.

Review coverage was incomplete.


Reviewed: faab9adae42d · Review report · Previous reports

permalink

<!-- forgejo-review-bot:bitcoin/bitcoin --> <!-- ralph-engine:current:95cedc5d372e2509a5cb777a0ac827f72f4380472ef1dd5dd7371b27772a2c7e:1ed10c4979af6fc548d6b8d4534d505e02e84ac4b0aa4f8633555b2ba75119e8 --> <!-- ralph-base:08ca210a92107f3d396b3be9ad34dcbb8f33933b --> <!-- ralph-head:faab9adae42d6182f455fb7fdbed1c6d9e41e797 --> <!-- ralph-case:fbe9e5691364da857d184e44594fc49239cd6ce0ce082af8674c8742c04dd074 --> No verified findings are available from this review. Review coverage was incomplete. <!-- Review tier: routine --> --- Reviewed: [`faab9adae42d`](<https://git.fish.foo/bitcoin/bitcoin/commit/faab9adae42d6182f455fb7fdbed1c6d9e41e797>) · [Review report](<https://review.fish.foo/report/36952-faab9adae42d6182f455fb7fdbed1c6d9e41e797-2991-1.html>) · [Previous reports](<https://review.fish.foo/traces/36952/>) [permalink](<https://review.fish.foo/report/36952-faab9adae42d6182f455fb7fdbed1c6d9e41e797-2991-1.html>)
hodlinator (Migrated from github.com) approved these changes 2026-11-24 09:39:44 +00:00
hodlinator (Migrated from github.com) left a comment
ACK faab9adae42d6182f455fb7fdbed1c6d9e41e797
Lines 698-700
hodlinator (Migrated from github.com) commented 2026-11-24 09:38:07 +00:00

nit: I generally prefer including parens in function/macro references but they aren't used in the the rest of this section so could omit them for consistency.

* `AssertUnreachable` should be used to mark code that can never be reached,
  for example after a `switch` that handles every enum value. Like `Assert`, it
  aborts if it is reached. `NONFATAL_UNREACHABLE` is the counterpart for code
nit: I generally prefer including parens in function/macro references but they aren't used in the the rest of this section so could omit them for consistency. ```suggestion * `AssertUnreachable` should be used to mark code that can never be reached, for example after a `switch` that handles every enum value. Like `Assert`, it aborts if it is reached. `NONFATAL_UNREACHABLE` is the counterpart for code ```
maflcko (Migrated from github.com) reviewed 2026-11-24 09:46:56 +00:00
Lines 698-700
maflcko (Migrated from github.com) commented 2026-11-24 09:46:56 +00:00

I think from the context it should be clear that something is passed to the functions above. However, here it is cheap and could make sense to clarify nothing is passed.

So I think I'll leave as-is for now.

I think from the context it should be clear that something is passed to the functions above. However, here it is cheap and could make sense to clarify nothing is passed. So I think I'll leave as-is for now.
optout21 commented 2026-12-01 13:25:51 +00:00 (Migrated from github.com)
ACK faab9adae42d6182f455fb7fdbed1c6d9e41e797
maflcko commented 2026-12-02 12:23:17 +00:00 (Migrated from github.com)

rfm or does it need more review?

rfm or does it need more review?
l0rinc commented 2026-12-02 13:51:34 +00:00 (Migrated from github.com)

code review ACK faab9adae4

code review ACK faab9adae42d6182f455fb7fdbed1c6d9e41e797
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
bitcoin/bitcoin!36952
No description provided.