Skip to content

feat: add minimal scaffolding for std feature#161

Open
fogti wants to merge 1 commit intomasterfrom
no-std-minimal
Open

feat: add minimal scaffolding for std feature#161
fogti wants to merge 1 commit intomasterfrom
no-std-minimal

Conversation

@fogti
Copy link
Copy Markdown
Member

@fogti fogti commented Jan 21, 2026

Cherry-picked 78cfea8.

Note that this doesn't make async-executor actually work in a no-std setting by default (due to lack of locks, etc.), but it puts all the stuff in place that will always be necessary, no matter which lock implementation is actually used.

@fogti fogti force-pushed the no-std-minimal branch 5 times, most recently from bccd5f9 to fb08aa6 Compare January 21, 2026 14:19
@fogti fogti requested a review from zeenix January 21, 2026 14:23
Copy link
Copy Markdown
Member

@zeenix zeenix left a comment

Choose a reason for hiding this comment

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

LGTM but isn't this a breaking change?

Comment thread src/static_executors.rs
@fogti
Copy link
Copy Markdown
Member Author

fogti commented Jan 21, 2026

Maybe (it does break building async-executor with default-features = false).

@fogti fogti force-pushed the no-std-minimal branch 3 times, most recently from 4dd839b to 51484cf Compare January 21, 2026 17:23
@fogti fogti requested a review from zeenix January 21, 2026 17:23
@fogti fogti marked this pull request as draft January 21, 2026 17:34
@fogti
Copy link
Copy Markdown
Member Author

fogti commented Jan 21, 2026

(Marked as draft because we need to wait for the current release to get finished)

@zeenix
Copy link
Copy Markdown
Member

zeenix commented Jan 21, 2026

Maybe (it does break building async-executor with default-features = false).

Yeah, adding a default feature that gates existing functionality/api, is a breaking change for sure.

Comment thread src/lib.rs Outdated
#[cfg(feature = "std")]
let mut rng = fastrand::Rng::new();
#[cfg(not(feature = "std"))]
let mut rng = fastrand::Rng::with_seed(0);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would recommend using either a pre-set value other than 0 or the address of a function as the seed here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Is this better (unfortunately, one can't use the address of the current function, because it's async and is unnameable (at least I couldn't find a way to state it).

@fogti fogti marked this pull request as ready for review February 18, 2026 19:57
Co-authored-by: Έλλεν Εμίλια Άννα Zscheile <fogti+devel@ytrizja.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants