-
Notifications
You must be signed in to change notification settings - Fork 69
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
Add std flag #1266
base: main
Are you sure you want to change the base?
Add std flag #1266
Conversation
@@ -48,7 +48,7 @@ | |||
compile_error!("'testutils' feature is not supported on 'wasm' target"); | |||
|
|||
// When used in a no_std contract, provide a panic handler as one is required. | |||
#[cfg(all(not(feature = "alloc"), target_family = "wasm"))] | |||
#[cfg(all(not(feature = "alloc"), not(feature = "std"), target_family = "wasm"))] |
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.
This can be breaking for someone, can't it? No-one would have the new feature enabled, so handle_panic
may disappear suddenly. Wouldn't it be safer to add a feature that disables handle_panic
on-demand?
There's a variety of situations that we could support, and so I'm not sure using 'std' as the name of this feature is most appropriate because of the possible variety of interpretations. Here's a matrix of configurations that could be supported. Only the two configurations with text in there are the ones currently supported. The text in the boxes is the feature enabled to get those things. Today we have:
If this PR is merged, the result would be support for:
If we wanted to support all these things, we could add the following features:
To that end, I think this PR's new feature could be named |
What
Adds a new feature and disables allocator when std flag is set.
Why
Allows to use the std while having a custom allocator.
Known limitations
N/A