about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2018-05-07 23:25:05 -0400
committerNiko Matsakis <niko@alum.mit.edu>2018-05-09 23:21:24 -0300
commited72950fdee7fe53cb52584c249d21fd03b0672e (patch)
tree52b41fe841fc8838a6826223e2a4c54b6cd96a0c /src/test
parent1fb17aba6921e80bd5ad20b85b5df5334a6e32b7 (diff)
downloadrust-ed72950fdee7fe53cb52584c249d21fd03b0672e.tar.gz
rust-ed72950fdee7fe53cb52584c249d21fd03b0672e.zip
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.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/borrowck/mut-borrow-in-loop.nll.stderr15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/test/ui/borrowck/mut-borrow-in-loop.nll.stderr b/src/test/ui/borrowck/mut-borrow-in-loop.nll.stderr
index fc288e6b1d6..2284f0784c5 100644
--- a/src/test/ui/borrowck/mut-borrow-in-loop.nll.stderr
+++ b/src/test/ui/borrowck/mut-borrow-in-loop.nll.stderr
@@ -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