Feat: Allow lifetime for bounds in non-binded generic params#107
Merged
daxpedda merged 6 commits intoModProg:mainfrom Apr 15, 2025
Merged
Feat: Allow lifetime for bounds in non-binded generic params#107daxpedda merged 6 commits intoModProg:mainfrom
daxpedda merged 6 commits intoModProg:mainfrom
Conversation
daxpedda
requested changes
Apr 14, 2025
Collaborator
daxpedda
left a comment
There was a problem hiding this comment.
This is indeed a very strange quirk of Rust!
Please add a changelog entry as well.
Otherwise LGTM!
daxpedda
requested changes
Apr 14, 2025
Collaborator
daxpedda
left a comment
There was a problem hiding this comment.
- Run
cargo +nightly fmt. - Changelog entry.
Contributor
Author
|
Completely missed the changelog request! Sorry about that. Should be good to go now I think |
Co-authored-by: daxpedda <[email protected]>
Co-authored-by: daxpedda <[email protected]>
e6acb63 to
c882e1c
Compare
Contributor
Author
|
Hey @daxpedda was wondering if there are any plans to cut a new release soon. We're currently working on a private registry so we aren't blocked on this or anything, but just wanted to ask since its been a while since the last one. Thanks! :) Edit: just noticed the new PR... 🤦 that pretty much answers my question lol. |
Merged
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.
It's currently not possible to use higher rank trait bounds without providing custom predicate type bounds. Our particular use case is enabling "trivial bounds" without requiring the nightly feature. For context: rust-lang/rust#48214 (comment)
For example:
This is useful for adding perfect derives to macro-generated structs.
I'm not fully sure whether having a HRTB should make
has_type_paramreturn false or not. I think its probably fine to keep it returning true since adding one that's not used doesn't change the behavior; it should still be derivable w/ the standard derive. Users can always make type aliases to get around this anyways if they disagree lol.