Merge bitcoin/bitcoin#27774: refactor: Add [[nodiscard]] where ignoring a Result return type is an error

fa5680b752 fix includes for touched header files (iwyu) (MarcoFalke)
dddde27f6f Add [[nodiscard]] where ignoring a Result return type is an error (MarcoFalke)

Pull request description:

  Only add it for those where it is an error to ignore. Also, fix the gcc compile warning https://github.com/bitcoin/bitcoin/pull/25977#issuecomment-1564350880. Also, fix iwyu for touched header files.

ACKs for top commit:
  TheCharlatan:
    ACK fa5680b752
  stickies-v:
    ACK fa5680b752

Tree-SHA512: c3509103bfeae246e2cf565bc561fcd68d8118515bac5431ba5304c3a63c8254b9c4f40e268b6f6d6b79405675c5a960db9b4eb3bdd14aedca333dc1c9e76415
This commit is contained in:
fanquake
2023-05-30 15:15:03 +01:00
7 changed files with 14 additions and 15 deletions

View File

@@ -7,8 +7,6 @@
#include <util/result.h>
struct bilingual_str;
namespace kernel {
struct Context;
@@ -16,8 +14,7 @@ struct Context;
/**
* Ensure a usable environment with all necessary library support.
*/
util::Result<void> SanityChecks(const Context&);
}
[[nodiscard]] util::Result<void> SanityChecks(const Context&);
} // namespace kernel
#endif // BITCOIN_KERNEL_CHECKS_H