Merge rust-bitcoin/rust-bitcoin#2442: Remove non_exhaustive from struct errors with pub inner

8c17ad7fd7 Remove non_exhaustive from struct errors with pub inner (Tobin C. Harding)

Pull request description:

  Using `non_exhaustive` as well as a public inner field is incorrect, it prohibits users from creating or matching on the error and does not achieve forward comparability.

  This was never right, we shouldn't have done it.

ACKs for top commit:
  Kixunil:
    ACK 8c17ad7fd7
  apoelstra:
    ACK 8c17ad7fd7

Tree-SHA512: 41266aaea25e0e5dba22200725e71f7cc23f386f3990c9d0b831980db2cfb431791ba14d6c6b144bd7db90f2f5dc9df38856f23fade0d7aee68217c4c879d3e0
This commit is contained in:
Andrew Poelstra 2024-02-05 15:25:28 +00:00
commit 92a0969994
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
2 changed files with 0 additions and 4 deletions

View File

@ -1042,7 +1042,6 @@ impl Transaction {
/// Error attempting to do an out of bounds access on the transaction inputs vector.
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub struct InputsIndexError(pub IndexOutOfBoundsError);
impl fmt::Display for InputsIndexError {
@ -1062,7 +1061,6 @@ impl From<IndexOutOfBoundsError> for InputsIndexError {
/// Error attempting to do an out of bounds access on the transaction outputs vector.
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub struct OutputsIndexError(pub IndexOutOfBoundsError);
impl fmt::Display for OutputsIndexError {

View File

@ -504,7 +504,6 @@ impl TapSighashType {
/// Integer is not a consensus valid sighash type.
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub struct InvalidSighashTypeError(pub u32);
impl fmt::Display for InvalidSighashTypeError {
@ -521,7 +520,6 @@ impl std::error::Error for InvalidSighashTypeError {
/// This type is consensus valid but an input including it would prevent the transaction from
/// being relayed on today's Bitcoin network.
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub struct NonStandardSighashTypeError(pub u32);
impl fmt::Display for NonStandardSighashTypeError {