Skip to content

Conversation

@jacobsa
Copy link

@jacobsa jacobsa commented Dec 15, 2025

In reality this value should never be invalid. Teaching this to the compiler improves benchmarks for some low-level task polling code I'm working on by 3-4% in practice.

In order to avoid diffs in later commits.
Give the inner field a name to prevent/discourage direct use, ensuring
the invariant that it always has a valid value. This will be necessary
for an upcoming commit that takes advantage of that invariant.

I tried instead putting the enum into a module and controlling this with
visibility, but I couldn't make it work correctly for enums defined
within a function, as in the case of the doc tests.
In reality this value should never be invalid. Teaching this to the
compiler improves benchmarks for some low-level task polling code I'm
working on by 3-4% in practice.
@jacobsa
Copy link
Author

jacobsa commented Dec 23, 2025

Hi, is there anyone who can have a look at this? I've potentially got another pull request to send (use #[inline(always)] for atomic manipulations), but I'm not sure if anybody is looking at them.

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.

1 participant