Skip to content

Conversation

@brody4hire
Copy link
Contributor

@brody4hire brody4hire 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

@brody4hire brody4hire marked this pull request as ready for review January 7, 2025 02:22
@brody4hire brody4hire changed the title use panic::AssertUnwindSafe from core in futures-core (etc.) no-std panic::AssertUnwindSafe in futures-core (etc.) Jan 7, 2025
@brody4hire brody4hire changed the title no-std panic::AssertUnwindSafe in futures-core (etc.) core: no-std panic::AssertUnwindSafe (etc.) Jan 7, 2025
#[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.)

@brody4hire
Copy link
Contributor Author

Is this PR based on a specific use case? Or is this a “do it because it's possible” style of PR?

I was trying to get as much functionality as possible working with no-std.

catch_unwind is not in core, so I don't think using this in core is that common

Makes sense to me, closing then.

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

https://github.com/nbdd0121/unwinding

Thanks!

@brody4hire brody4hire closed this Jan 14, 2025
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