Skip to content

Don't bind closures that capture lifetimes in a function return type. - #2007

Open
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_981256199
Open

copybara-service[bot] wants to merge 1 commit into
mainfrom
test_981256199

Conversation

@copybara-service

Copy link
Copy Markdown

Don't bind closures that capture lifetimes in a function return type.

Because we generate a little bit of glue code around closures that will
wrap them in a temporary closure at thunk boundaries, lifetimes in those
closures were causing borrow checker errors in generated code.
Specifically when a closure involved a lifetime that also appeared in
the return type of the function. Fix this by preventing bindings in
those cases.

Because we generate a little bit of glue code around closures that will
wrap them in a temporary closure at thunk boundaries, lifetimes in those
closures were causing borrow checker errors in generated code.
Specifically when a closure involved a lifetime that also appeared in
the return type of the function. Fix this by preventing bindings in
those cases.

PiperOrigin-RevId: 981256199
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