doc: AssertUnreachable and NONFATAL_UNREACHABLE #36952

pull maflcko wants to merge 1 commits into bitcoin:master from maflcko:2611-doc-Unreachable changing 2 files +35 −36
  1. maflcko commented at 2:02 PM on November 23, 2026: member
    • 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.
  2. doc: AssertUnreachable and NONFATAL_UNREACHABLE
    * Move the "Assertions and Checks" section from "tips and tricks" to
      "guidelines". (Can be reviewed via --color-moved=dimmed-zebra)
    * Add missing point on AssertUnreachable and NONFATAL_UNREACHABLE.
    * Compress the NONFATAL_UNREACHABLE docstring.
    faab9adae4
  3. DrahtBot added the label Docs on Nov 23, 2026
  4. DrahtBot commented at 2:02 PM on November 23, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    External sites

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

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

    Type Reviewers
    ACK hodlinator

    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 <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-->

  5. fanquake requested review from ryanofsky on Nov 23, 2026
  6. in doc/developer-notes.md:698 in faab9adae4
     693 | +     but a failed assumption does not result in a fatal bug. A failed
     694 | +     assumption may or may not result in a slightly degraded user experience,
     695 | +     but it is safe to continue program execution.
     696 | +* `AssertUnreachable()` should be used to mark code that can never be reached,
     697 | +  for example after a `switch` that handles every enum value. Like `Assert`, it
     698 | +  aborts if it is reached. `NONFATAL_UNREACHABLE()` is the counterpart for code
    


    hodlinator commented at 9:38 AM on November 24, 2026:

    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
    

    maflcko commented at 9:46 AM on November 24, 2026:

    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.

  7. hodlinator approved
  8. hodlinator commented at 9:39 AM on November 24, 2026: contributor

    ACK faab9adae42d6182f455fb7fdbed1c6d9e41e797


ryanofsky

Labels

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-11-30 03:50 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me