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

improved error reporting for UnwrapThrowExt for Result #4035

Merged
merged 2 commits into from
Aug 1, 2024

Conversation

sokorototo
Copy link
Contributor

Since Result<T, E: fmt::Debug> has access to E: fmt::Debug, this PR modifies the default implementation of UnwrapThrowExt::unwrap_throw() to include this extra information. This is my first PR, and I'm open to criticism

Copy link
Collaborator

@daxpedda daxpedda left a comment

Choose a reason for hiding this comment

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

Wow, nice!
Thank you!

@daxpedda
Copy link
Collaborator

daxpedda commented Aug 1, 2024

I will add a changelog entry.

@daxpedda daxpedda merged commit 5490ed2 into rustwasm:main Aug 1, 2024
23 checks passed
Comment on lines +1386 to +1389
if cfg!(all(
target_arch = "wasm32",
not(any(target_os = "emscripten", target_os = "wasi"))
)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This needs to be gated behind cfg(debug_assertions), the same as the default unwrap_throw implementation; see #2995 (review).

(The cfg(feature = "std") might not be needed anymore after #4005.)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thank you!
Addressed in #4042.

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.

3 participants