Skip to content
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

fixed UnwrapThrowExt formatting to align with core #2835

Closed

Conversation

jquesada2016
Copy link

This pull request closes #2732

@alexcrichton
Copy link
Contributor

I believe it was originally intended that the E was ignored since the purpose of using these methods was to avoid the panicking infrastructure and have a lightweight cost in terms of code size. Additionally these methods are also somewhat broken where destructors for values on the stack are not run yet the instance can still be reentered. This isn't actually memory safe in Rust and is a long outstanding but in wasm-bindgen.

@jquesada2016
Copy link
Author

jquesada2016 commented Mar 21, 2022

I do get the desire to shave off the baggage that comes with the panicking infrastructure, but it is very useful and makes debugging much more painful then it needs to be.

How about feature gating this?

Also, since the E is ignored, it would also be prudent to drop the E: Debug constraint.

Edit:
Nevermind, I forgot for a moment this has the original behavior on non-wasm targets.

@alexcrichton
Copy link
Contributor

GIven the type bounds in play I think I'd prefer to keep this as-is and avoid the complication of feature gating and such. This is just a trait implementation so it's always possible to do something else externally as well.

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.

UnwrapThrowExt should propagate the error for Result<T, E>
2 participants