From 801c3f060fc3bf25a730d89aa0b80da4493f3584 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Tue, 20 Nov 2018 17:48:16 -0300 Subject: Fix erroneous loop diagnostic in nll This commit fixes the logic of detecting when a use happen in a later iteration of where a borrow was defined Fixes #53773 --- src/test/ui/vec/vec-mut-iter-borrow.nll.stderr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/test/ui/vec') diff --git a/src/test/ui/vec/vec-mut-iter-borrow.nll.stderr b/src/test/ui/vec/vec-mut-iter-borrow.nll.stderr index 73cddd8d680..c77be26f019 100644 --- a/src/test/ui/vec/vec-mut-iter-borrow.nll.stderr +++ b/src/test/ui/vec/vec-mut-iter-borrow.nll.stderr @@ -5,7 +5,7 @@ LL | for x in &mut xs { | ------- | | | first mutable borrow occurs here - | first borrow used here, in later iteration of loop + | first borrow later used here LL | xs.push(1) //~ ERROR cannot borrow `xs` | ^^ second mutable borrow occurs here -- cgit 1.4.1-3-g733a5