Skip to content

Future proof error types#1148

Closed
tcharding wants to merge 2 commits intorust-bitcoin:masterfrom
tcharding:07-29-rm-error-derives
Closed

Future proof error types#1148
tcharding wants to merge 2 commits intorust-bitcoin:masterfrom
tcharding:07-29-rm-error-derives

Conversation

@tcharding
Copy link
Copy Markdown
Member

@tcharding tcharding commented Jul 28, 2022

EDIT: Bother, I did not see #1143 before doing this work.

Done in an attempt to future proof our error types i.e., to prevent us
from inadvertently, or otherwise, making breaking API changes.

For all publicly exposed error types:

  • Remove all the derives except Debug.
  • Enforce Send/Sync using custom macro.

ref: #1127 (comment)

We only typically put a single newline between functions and types.
Done in an attempt to future proof our error types i.e., to prevent us
from inadvertently, or otherwise, making breaking API changes.

For all publicly exposed error types:

- Remove all the derives except `Debug`.
- Enforce `Send`/`Sync` using custom macro.
@tcharding tcharding marked this pull request as draft July 28, 2022 23:54
Copy link
Copy Markdown
Collaborator

@Kixunil Kixunil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't intend to say that we should remove Clone or even PartialEq, just to think carefully about them.

/// In an attempt to guarantee forward compatibility for error types we only derive `Debug` and we
/// use this trait to commit to `Send`/`Sync`.
#[doc(hidden)]
pub trait AssertSendSync: Send + Sync {}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I specifically didn't want it public. pub(crate) is fine.

@tcharding
Copy link
Copy Markdown
Member Author

Closing this, leaving error work for another day.

@tcharding tcharding closed this Oct 20, 2022
@tcharding tcharding deleted the 07-29-rm-error-derives branch January 12, 2023 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants