Skip to content
This repository has been archived by the owner on Sep 12, 2024. It is now read-only.

Changes needed to get panic_error method added to std/core #29

Open
5 tasks
seanchen1991 opened this issue Feb 18, 2021 · 0 comments
Open
5 tasks

Changes needed to get panic_error method added to std/core #29

seanchen1991 opened this issue Feb 18, 2021 · 0 comments

Comments

@seanchen1991
Copy link
Member

seanchen1991 commented Feb 18, 2021

  • (Possibly) Move the Error trait to core.
  • Add a panic_error function to core::panic.
  • Update PanicInfo so that it can store a &dyn Error + 'static instead of a Box<dyn Any> (it might need to be Boxed as well).
  • Update the default panic handler in std to report errors via dyn Error instead of dyn Any if it is available, and to iterate over sources.
  • Add specializations to unwrap and expect to make them report errors via panic_error instead of panic! when the Err type implements Error.

Questions to resolve:

  1. Does the Error trait need to be moved into core for this to work?
  2. How does ownership of the Err type interact with unwinding?
  3. Can we get away with not Boxing the &dyn Error + 'static in PanicInfo? Can the error be caught and handled as a payload? Do we wish to avoid this?
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant