Skip to content

Conversation

@copybara-service
Copy link

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).

@copybara-service copybara-service bot force-pushed the test_861419007 branch 3 times, most recently from 13fed08 to 9320e7e Compare January 27, 2026 04:11
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).

PiperOrigin-RevId: 861419007
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant