-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[error] Implement std::error::Error on errors #1298
Conversation
42e9149
to
650df6a
Compare
I added a |
227763c
to
f8bd5db
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1298 +/- ##
==========================================
- Coverage 87.42% 87.31% -0.11%
==========================================
Files 15 15
Lines 5152 5289 +137
==========================================
+ Hits 4504 4618 +114
- Misses 648 671 +23 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went ahead and committed an example of how having a KnownLayout
bound can be used to improve our diagnostics. Generally speaking, I think we should consistently have Src: Deref
and Dst: ?Sized + KnownLayout
on our Display
and Error
impls. We can always relax the bounds later.
I can't think, right now, of how it might be useful for ValidityError
, but who knows — depending on how we evolve that trait, an opportunity might arise.
Discussed offline with @jswrenn. Here's the plan:
|
9155b18
to
bd81c69
Compare
While we're here, also relax `Dispaly for AlignmentError<Src, Dst>` to permit `Dst: ?Sized` in exchange for `Dst: KnownLayout`. This is an important relaxation since our APIs permit performing conversions into unsized destination types with runtime alignment checking. Also make all errors `Send + Sync` regardless of `Dst`, which only exists at the type level, but is never instantiated. Finally, make `Display`'s verbosity conditional on `debug_assertions`. Makes progress on #1297 Co-authored-by: John Wrenn <[email protected]>
While we're here, also relax
Dispaly for AlignmentError<Src, Dst>
to permitDst: ?Sized
in exchange forDst: KnownLayout
. This is an important relaxation since our APIs permit performing conversions into unsized destination types with runtime alignment checking.Makes progress on #1297