-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #2979: inference for lifetimes of & expressions
What we now do is to create a region variable for each & expression (and also each borrow). The lifetime of this variable will be checked by borrowck to ensure it is not greater than the lifetime of the underlying data. This both leads to shorter lifetimes in some cases but also longer in others, such as taking the address to the interior of unique boxes tht are rooted in region pointers (e.g., returning a pointer to the interior of a sendable map). This may lead to issue #2977 if the rvalue is not POD, because we may drop the data in trans sooner than borrowck expects us to. Need to work out precisely where that fix ought to occur.
- Loading branch information
1 parent
6ef13e7
commit 5d32d03
Showing
34 changed files
with
719 additions
and
322 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.