Add Type::lifetimes
to make getting lifetimes out of Type
easier
#409
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.
Forgive me because it's been a long time since I've looked at this repo- I don't remember how everything works but I wanted to get back into it.
I was looking at #406 and saw this part:
I thought a good first step for this would be to make getting the lifetimes of a field easy, so I added
Type::lifetimes
which returns a&[MaybeStatic<TypeLifetime>]
, essentially just consolidating where lifetimes are stored in theType
enum. This will allow for a higher-level api to use this andSubtypeLifetimeVisitor
to achieve what I quoted above with something like this:Today this doesn't compile because
MethodLifetime
!=TypeLifetime
, butSubtypeLifetimeVisitor
would probably be adjusted once each type declaration has their ownLifetimeEnv
.