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: ACK8c17ad7fd7
apoelstra: ACK8c17ad7fd7
Tree-SHA512: 41266aaea25e0e5dba22200725e71f7cc23f386f3990c9d0b831980db2cfb431791ba14d6c6b144bd7db90f2f5dc9df38856f23fade0d7aee68217c4c879d3e0
This commit is contained in:
commit
92a0969994
|
@ -1042,7 +1042,6 @@ impl Transaction {
|
||||||
|
|
||||||
/// Error attempting to do an out of bounds access on the transaction inputs vector.
|
/// Error attempting to do an out of bounds access on the transaction inputs vector.
|
||||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||||
#[non_exhaustive]
|
|
||||||
pub struct InputsIndexError(pub IndexOutOfBoundsError);
|
pub struct InputsIndexError(pub IndexOutOfBoundsError);
|
||||||
|
|
||||||
impl fmt::Display for InputsIndexError {
|
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.
|
/// Error attempting to do an out of bounds access on the transaction outputs vector.
|
||||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||||
#[non_exhaustive]
|
|
||||||
pub struct OutputsIndexError(pub IndexOutOfBoundsError);
|
pub struct OutputsIndexError(pub IndexOutOfBoundsError);
|
||||||
|
|
||||||
impl fmt::Display for OutputsIndexError {
|
impl fmt::Display for OutputsIndexError {
|
||||||
|
|
|
@ -504,7 +504,6 @@ impl TapSighashType {
|
||||||
|
|
||||||
/// Integer is not a consensus valid sighash type.
|
/// Integer is not a consensus valid sighash type.
|
||||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||||
#[non_exhaustive]
|
|
||||||
pub struct InvalidSighashTypeError(pub u32);
|
pub struct InvalidSighashTypeError(pub u32);
|
||||||
|
|
||||||
impl fmt::Display for InvalidSighashTypeError {
|
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
|
/// This type is consensus valid but an input including it would prevent the transaction from
|
||||||
/// being relayed on today's Bitcoin network.
|
/// being relayed on today's Bitcoin network.
|
||||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||||
#[non_exhaustive]
|
|
||||||
pub struct NonStandardSighashTypeError(pub u32);
|
pub struct NonStandardSighashTypeError(pub u32);
|
||||||
|
|
||||||
impl fmt::Display for NonStandardSighashTypeError {
|
impl fmt::Display for NonStandardSighashTypeError {
|
||||||
|
|
Loading…
Reference in New Issue