You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following tests report the lifetime mismatches nicely under AST borrowck but fail to do so under NLL.
Tests:
lifetime-errors/ex3-both-anon-regions-2.rs
(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 (ex3-both-anon-regions-2.rs)
AST diagnostic:
error[E0623]: lifetime mismatch
--> $DIR/ex3-both-anon-regions-2.rs:12:9
|
LL | fn foo((v, w): (&u8, &u8), x: &u8) {
| --- --- these two types are declared with different lifetimes...
LL | v = x; //~ ERROR lifetime mismatch
| ^ ...but data from `x` flows here
NLL diagnostic:
warning: not reporting region error due to nll
--> $DIR/ex3-both-anon-regions-2.rs:12:9
|
LL | v = x; //~ ERROR lifetime mismatch
| ^
Update (pnkfelix)
Wait, is this assignment actually legal under NLL? Seems like it shouldn't be legal. But the test could be made more robust to actually illustrate why such an assignment would be broken.
The text was updated successfully, but these errors were encountered:
The following tests report the lifetime mismatches nicely under AST borrowck but fail to do so under NLL.
Tests:
(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 (ex3-both-anon-regions-2.rs)
AST diagnostic:
NLL diagnostic:
Update (pnkfelix)
The text was updated successfully, but these errors were encountered: