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

None yet

1 participant