From f8084c675ed8d43da68dcec67aaccc576894b072 Mon Sep 17 00:00:00 2001 From: "Felix S. Klock II" Date: Wed, 15 Aug 2018 23:33:14 +0200 Subject: [PATCH] Removed `ignore-test-compare-mode-nll` from hashmap-lifetimes.rs by strengthening the test there. --- src/test/ui/hashmap-lifetimes.nll.stderr | 13 +++++++++++++ src/test/ui/hashmap-lifetimes.rs | 3 ++- src/test/ui/hashmap-lifetimes.stderr | 1 + 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 src/test/ui/hashmap-lifetimes.nll.stderr diff --git a/src/test/ui/hashmap-lifetimes.nll.stderr b/src/test/ui/hashmap-lifetimes.nll.stderr new file mode 100644 index 000000000000..943b684fe8d7 --- /dev/null +++ b/src/test/ui/hashmap-lifetimes.nll.stderr @@ -0,0 +1,13 @@ +error[E0502]: cannot borrow `my_stuff` as mutable because it is also borrowed as immutable + --> $DIR/hashmap-lifetimes.rs:18:5 + | +LL | let mut it = my_stuff.iter(); + | -------- immutable borrow occurs here +LL | my_stuff.insert(1, 43); //~ ERROR cannot borrow + | ^^^^^^^^^^^^^^^^^^^^^^ mutable borrow occurs here +LL | it; + | -- borrow later used here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0502`. diff --git a/src/test/ui/hashmap-lifetimes.rs b/src/test/ui/hashmap-lifetimes.rs index 9418c34cbfda..eb7404e7b780 100644 --- a/src/test/ui/hashmap-lifetimes.rs +++ b/src/test/ui/hashmap-lifetimes.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// ignore-compare-mode-nll + fn main() { let mut my_stuff = std::collections::HashMap::new(); @@ -16,4 +16,5 @@ fn main() { let mut it = my_stuff.iter(); my_stuff.insert(1, 43); //~ ERROR cannot borrow + it; } diff --git a/src/test/ui/hashmap-lifetimes.stderr b/src/test/ui/hashmap-lifetimes.stderr index eb129848ed2d..187c98ab298b 100644 --- a/src/test/ui/hashmap-lifetimes.stderr +++ b/src/test/ui/hashmap-lifetimes.stderr @@ -5,6 +5,7 @@ LL | let mut it = my_stuff.iter(); | -------- immutable borrow occurs here LL | my_stuff.insert(1, 43); //~ ERROR cannot borrow | ^^^^^^^^ mutable borrow occurs here +LL | it; LL | } | - immutable borrow ends here