Merge bitcoin/bitcoin#34639: iwyu: Document or remove some pragma: export and other improvements

0fe6fccec2 doc: Document rationale for using `IWYU pragma: export` (Hennadii Stepanov)
cfa3b10d50 iwyu, doc: Document `IWYU pragma: export` for `<logging/categories.h>` (Hennadii Stepanov)
015bea05e6 iwyu, doc: Document `IWYU pragma: export` for `<chrono>` (Hennadii Stepanov)
48bfcfedec iwyu, doc: Document `IWYU pragma: export` for `<threadsafety.h>` (Hennadii Stepanov)
179abb387f refactor: Move `StdMutex` to its own header (Hennadii Stepanov)
6d2952c3c3 serialize: Add missing `<span>` header (Hennadii Stepanov)

Pull request description:

  This PR is a prerequisite for https://github.com/bitcoin/bitcoin/pull/34448. It was split into a separate PR to limit the scope and minimize potential merge conflicts.

  The first commit improves the accuracy of IWYU suggestions within our heavily templated code. Note that, for now, the `serialize.h` header itself is excluded from IWYU inspection because it lacks a corresponding source file.

  The remaining commits follow the Developer Notes [guidance](https://github.com/bitcoin/bitcoin/blob/master/doc/developer-notes.md#using-iwyu):
  > Use `IWYU pragma: export` very sparingly, as this enforces transitive inclusion of headers and undermines the specific purpose of IWYU.

ACKs for top commit:
  maflcko:
    review ACK 0fe6fccec2 👤
  ajtowns:
    utACK 0fe6fccec2

Tree-SHA512: dc2d4e3ff78b9707a1a26cb9b1c0a456de0d33c59e773bbf692344c2fceaff8936317479c5e898038f29134bc0e5d9d1ef7350e53512dd8e262f46ede578c4f9
This commit is contained in:
merge-script
2026-03-23 11:17:13 +08:00
30 changed files with 56 additions and 47 deletions

View File

@@ -22,7 +22,6 @@
#include <map>
#include <memory>
#include <span>
#include <utility>
#include <version>

View File

@@ -13,8 +13,8 @@
#include <primitives/transaction.h>
#include <txgraph.h>
#include <util/overflow.h>
#include <util/time.h>
#include <chrono>
#include <cstddef>
#include <cstdint>
#include <functional>

View File

@@ -8,8 +8,8 @@
#include <policy/feerate.h>
#include <policy/policy.h>
#include <util/time.h>
#include <chrono>
#include <cstdint>
#include <optional>