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

Change errors to use thiserror #283

Open
1 task
hackaugusto opened this issue Feb 27, 2024 · 4 comments
Open
1 task

Change errors to use thiserror #283

hackaugusto opened this issue Feb 27, 2024 · 4 comments

Comments

@hackaugusto
Copy link
Contributor

  • Change the error implementation to use thiserror crate

related: 0xPolygonMiden/miden-node#62

@bobbinth
Copy link
Contributor

The main reason for why we are not using this currently is that thiserror requires std. Would would be the strategy for handling no-std context if we do switch to thiserror?

@plafer
Copy link
Contributor

plafer commented Feb 27, 2024

We can't do thiserror for no_std crates unfortunately. I believe the next best alternative is to use displaydoc (as explained in this thiserror thread).

@hackaugusto
Copy link
Contributor Author

Humm, I didn't know thiserror didn't support no-std. Maybe lets move everything to displaydoc?

@plafer
Copy link
Contributor

plafer commented Feb 27, 2024

For the future: thiserror will support no_std when std::error::Error is moved to core. nightly supports this with the feature flag #![feature(error_in_core)], and here is the tracking issue to stabilize the feature.

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

No branches or pull requests

3 participants