Use adt_const_params for Scope and Semantics const generics - #635
Open
nazar-pc wants to merge 1 commit into
Open
Use adt_const_params for Scope and Semantics const generics#635nazar-pc wants to merge 1 commit into
adt_const_params for Scope and Semantics const generics#635nazar-pc wants to merge 1 commit into
Conversation
Firestar99
force-pushed
the
adt_const_params-scope-semantics
branch
from
August 4, 2026 11:40
80bf1ad to
0c20561
Compare
Firestar99
reviewed
Aug 4, 2026
Firestar99
left a comment
Member
There was a problem hiding this comment.
Not considering this patch requiring a nightly feature, I think the patch looks good. I squashed in a small cleanup to deduplicate
- const {
- assert!(
- SEMANTICS.has_valid_ordering(),
- "at most one memory-ordering flag (ACQUIRE, RELEASE, ACQUIRE_RELEASE or \
- SEQUENTIALLY_CONST) may be set"
- );
- }
-
+ const { SEMANTICS.assert_valid() }Give me an hour or two, I have an idea I want to toy around with that may solve our stable vs nightly feature problem...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This implements #607 and resolves #414 using
adt_const_params.Implementation has been on nightly for a long time without major known issues AFAIK. docs.rs already compiles docs with nightly toolchain, so should not be a problem there either.
This makes developer experience better with improved type safety. As a bonus ordering validity is now checked at compile time.
|between memory semantics options is technically possible with even more nightly features, but didn't seem worth it for now.The changes are essentially mechanical.