rework causal tracking to explore outlives relationships

Instead of tracking the "cause" of each bit that gets added, try to
recover that by walking outlives relationships. This is currently
imprecise, since it ignores the "point" where the outlives relationship
is incurred -- but that's ok, since we're about to stop considering that
overall in a later commit. This does seem to affect one error message
negatively, I didn't dig *too* hard to find out why.
This commit is contained in:
Niko Matsakis 2018-05-07 23:25:05 -04:00
parent 1fb17aba69
commit ed72950fde
5 changed files with 42 additions and 100 deletions

View file

@ -2,19 +2,28 @@ error[E0499]: cannot borrow `*arg` as mutable more than once at a time
--> $DIR/mut-borrow-in-loop.rs:20:25
|
LL | (self.func)(arg) //~ ERROR cannot borrow
| ^^^ mutable borrow starts here in previous iteration of loop
| ------------^^^-
| | |
| | mutable borrow starts here in previous iteration of loop
| borrow later used here
error[E0499]: cannot borrow `*arg` as mutable more than once at a time
--> $DIR/mut-borrow-in-loop.rs:26:25
|
LL | (self.func)(arg) //~ ERROR cannot borrow
| ^^^ mutable borrow starts here in previous iteration of loop
| ------------^^^-
| | |
| | mutable borrow starts here in previous iteration of loop
| borrow later used here
error[E0499]: cannot borrow `*arg` as mutable more than once at a time
--> $DIR/mut-borrow-in-loop.rs:33:25
|
LL | (self.func)(arg) //~ ERROR cannot borrow
| ^^^ mutable borrow starts here in previous iteration of loop
| ------------^^^-
| | |
| | mutable borrow starts here in previous iteration of loop
| borrow later used here
error: aborting due to 3 previous errors