feat(features): remove FeatureBits bounds that are not elaborated and seal FeatureBits#20
Open
feat(features): remove FeatureBits bounds that are not elaborated and seal FeatureBits#20
FeatureBits bounds that are not elaborated and seal FeatureBits#20Conversation
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.
When users wanted to be generic over
FeatureBitsbefore, they had to duplicate the list of non-supertrait where bounds because only supertrait bounds are elaborated:This PR removes the not-elaborated where clauses to make generic code less verbose:
Of course, if the generic function wants to use some non-elaborated bounds, that is still possible.
cargo-semver-checksdetects this as a breaking change, but I don't think it actually is. I think it does not handle the fact thatTrait: Supertraitis equivalent toTrait where Self: Supertrait.Still, we need to do a breaking release anyway because of #18, so this PR also seals
FeatureBits. I don't think anyone would want to implementFeatureBitsoutside this crate without the internal helper macros anyway.