HomePhabricator

Disable util::Result copying and assignment

Description

Disable util::Result copying and assignment

Summary:

It disables copying of util::Result objects because unnecessary copies are inefficient and not possible after #25665, which makes util::Result object move-only.

It disables the assignment operator and replaces it with an Update() method, because #25665 adds more information to util::Result objects (warning and error messages and failure values) and having an assignment operator that overwrites data instead of merging it would make it easy to accidentally erase existing information while trying to assign new information.

Backport of core#29906.

Test Plan:

ninja all check-all

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Differential Revision: https://reviews.bitcoinabc.org/D17970

Details

Provenance
Ryan Ofsky <ryan@ofsky.org>Authored on Sep 15 2022, 15:15
FabienCommitted on Wed, Apr 23, 08:16
FabienPushed on Wed, Apr 23, 08:16
Reviewer
Restricted Project
Differential Revision
D17970: Disable util::Result copying and assignment
Parents
rABC0971f430079f: [avalanche] Fix a lock order inversion
Branches
Unknown
Tags
Unknown