The following tests all have a common weakness around how they report errors under NLL. Under AST borrowck they would say something somewhat understandable about closures. But under NLL they don't anymore.
List:
(This list of tests is drawn from an informal paper document that I have been using to keep notes for myself as I work on this...)
Example (from ui/borrowck/issue-45983.rs):
AST borrowck says:
error: borrowed data cannot be stored outside of its closure
--> $DIR/issue-45983.rs:17:27
|
LL | let x = None;
| - borrowed data cannot be stored into here...
LL | give_any(|y| x = Some(y));
| --- ^ cannot be stored outside of its closure
| |
| ...because it cannot outlive this closure
NLL says:
error: free region `` does not outlive free region `'_#2r`
--> $DIR/issue-45983.rs:17:27
|
LL | give_any(|y| x = Some(y));
| ^
The following tests all have a common weakness around how they report errors under NLL. Under AST borrowck they would say something somewhat understandable about closures. But under NLL they don't anymore.
List:
(This list of tests is drawn from an informal paper document that I have been using to keep notes for myself as I work on this...)
Example (from
ui/borrowck/issue-45983.rs):AST borrowck says:
NLL says: