Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lifetime and scope clarification in Closure types reference. #1434

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

stegrams
Copy link

@stegrams stegrams commented Dec 6, 2023

As I understood so far, lifetime is affecting the borrowing rules enforcement, scope on the other hand, has to do with memory deallocation.
The variables' lifetime ends the last time the compiler locates its usage, whereas the scope ends with a distinct symbol, i.e. right bracket.

As I understood so far, lifetime is affecting the borrowing rules enforcement, scope on the other hand, has to do with memory deallocation.
Most of the time, these two concepts are not overlapped.
The only case I'm aware they do, is that of the temporary variables in `let` statements.
@traviscross
Copy link
Contributor

The changes in the following PR may address the motivation for the change in this one:

@traviscross traviscross added the S-blocked Status: Marked as blocked on further work. label Jul 16, 2024
@rustbot

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-blocked Status: Marked as blocked on further work.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants