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

core: no-std panic::AssertUnwindSafe (etc.) #2908

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

brodycj
Copy link
Contributor

@brodycj brodycj commented Jan 7, 2025

STATUS:

I think the following PRs should be merged first to resolve the CI build issues:


WHAT:

  • use panic::AssertUnwindSafe from Rust core lib in futures-core
  • remove extern crate std not needed from futures-core & futures-sink

I would be happy to split these updates into separate PRs, if needed. I figured we may as well do these updates together.


CI testing TODO(s):


other TODO(s):

  • remove std option from futures-core & futures-sink - this would be another breaking change - I would be happy to do this here or in a separate PR

@brodycj brodycj marked this pull request as ready for review January 7, 2025 02:22
@brodycj brodycj mentioned this pull request Jan 7, 2025
4 tasks
@brodycj brodycj changed the title use panic::AssertUnwindSafe from core in futures-core (etc.) no-std panic::AssertUnwindSafe in futures-core (etc.) Jan 7, 2025
@brodycj brodycj changed the title no-std panic::AssertUnwindSafe in futures-core (etc.) core: no-std panic::AssertUnwindSafe (etc.) Jan 7, 2025
@@ -12,8 +12,6 @@

#[cfg(feature = "alloc")]
extern crate alloc;
#[cfg(feature = "std")]
extern crate std;
Copy link
Member

@taiki-e taiki-e Jan 12, 2025

Choose a reason for hiding this comment

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

This is necessary to generate the appropriate error if the user accidentally enables the std feature.

Otherwise, we may run into trouble with users who accidentally rely on the fact that currently we are not using std and get angry that their builds are broken during future patch releases.

@taiki-e
Copy link
Member

taiki-e commented Jan 12, 2025

Thanks for the PR.

Is this PR based on a specific use case? Or is this a “do it because it's possible” style of PR?
catch_unwind is not in core, so I don't think using this in core is that common.

(You can use catch_unwind from third-party no-std crate such as unwinding crate, but it doesn't need UnwindSafe.)

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.

2 participants