Make causal tracking lazy

This commit is contained in:
Santiago Pastorino 2018-07-01 19:43:01 -03:00
parent 24f91e8782
commit 0957ede502
No known key found for this signature in database
GPG key ID: 88C941CDA1D46432
14 changed files with 225 additions and 319 deletions

View file

@ -2,15 +2,10 @@ error[E0597]: `a` does not live long enough
--> $DIR/borrowing.rs:18:18
|
LL | unsafe { (|| yield &a).resume() }
| ^^^^^^^^^^^^^
| |
| borrowed value does not live long enough
| borrow may end up in a temporary, created here
| ^^^^^^^^^^^^^ borrowed value does not live long enough
LL | //~^ ERROR: `a` does not live long enough
LL | };
| -- temporary later dropped here, potentially using the reference
| |
| borrowed value only lives until here
| - borrowed value only lives until here
error[E0597]: `a` does not live long enough
--> $DIR/borrowing.rs:24:9

View file

@ -1,19 +1,11 @@
error[E0597]: `b` does not live long enough
--> $DIR/ref-escapes-but-not-over-yield.rs:24:13
|
LL | let mut b = move || {
| _________________-
LL | | yield();
LL | | let b = 5;
LL | | a = &b;
| | ^^ borrowed value does not live long enough
LL | | //~^ ERROR `b` does not live long enough
LL | | };
| | -
| | |
| | borrowed value only lives until here
| |_____temporary later dropped here, potentially using the reference
| borrow may end up in a temporary, created here
LL | a = &b;
| ^^ borrowed value does not live long enough
LL | //~^ ERROR `b` does not live long enough
LL | };
| - borrowed value only lives until here
error: aborting due to previous error

View file

@ -3,15 +3,9 @@ error[E0502]: cannot borrow `heap` as immutable because it is also borrowed as m
|
LL | let borrow = heap.peek_mut();
| ---- mutable borrow occurs here
LL |
LL | match (borrow, ()) {
| ------------ borrow may end up in a temporary, created here
LL | (Some(_), ()) => {
...
LL | println!("{:?}", heap); //~ ERROR cannot borrow `heap` as immutable
| ^^^^ immutable borrow occurs here
...
LL | };
| - temporary later dropped here, potentially using the reference
error: aborting due to previous error

View file

@ -2,14 +2,9 @@ error[E0597]: `*a` does not live long enough
--> $DIR/destructor-restrictions.rs:18:10
|
LL | *a.borrow() + 1
| ^---------
| |
| borrowed value does not live long enough
| borrow may end up in a temporary, created here
| ^ borrowed value does not live long enough
LL | }; //~^ ERROR `*a` does not live long enough
| -- temporary later dropped here, potentially using the reference
| |
| borrowed value only lives until here
| - borrowed value only lives until here
error: aborting due to previous error

View file

@ -2,28 +2,17 @@ error[E0597]: `y` does not live long enough
--> $DIR/issue-23338-locals-die-before-temps-of-body.rs:20:5
|
LL | y.borrow().clone()
| ^---------
| |
| borrowed value does not live long enough
| borrow may end up in a temporary, created here
| ^ borrowed value does not live long enough
LL | }
| -
| |
| borrowed value only lives until here
| temporary later dropped here, potentially using the reference
| - borrowed value only lives until here
error[E0597]: `y` does not live long enough
--> $DIR/issue-23338-locals-die-before-temps-of-body.rs:27:9
|
LL | y.borrow().clone()
| ^---------
| |
| borrowed value does not live long enough
| borrow may end up in a temporary, created here
| ^ borrowed value does not live long enough
LL | };
| -- temporary later dropped here, potentially using the reference
| |
| borrowed value only lives until here
| - borrowed value only lives until here
error: aborting due to 2 previous errors