Infer (some) lifetimes and record them in the new representation. #337
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.
Infer (some) lifetimes and record them in the new representation.
We're using plain string tokens for variables. This makes it easier
to deal with discovering new variable names as we recurse through types
(something we expect to do the vast majority of the time). This also
means that we need to be careful about variable capture.
The going idea is to allow ad-hoc lifetime names for function parameters,
possibly including function-typed function parameters, while requiring that
all lifetime parameters on type declarations to be explicitly declared.
We're also planning on assigning lifetime names to all viable references,
meaning that we may need a subsequent cleanup pass to produce
style-conformant Rust code (i.e., we shouldn't emit lifetime binders or
names in our generated code if Rust's standard elision algorithm would
produce equivalent definitions).