about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/hashmap-lifetimes.nll.stderr13
-rw-r--r--src/test/ui/hashmap-lifetimes.rs3
-rw-r--r--src/test/ui/hashmap-lifetimes.stderr1
3 files changed, 16 insertions, 1 deletions
diff --git a/src/test/ui/hashmap-lifetimes.nll.stderr b/src/test/ui/hashmap-lifetimes.nll.stderr
new file mode 100644
index 00000000000..943b684fe8d
--- /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 9418c34cbfd..eb7404e7b78 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 eb129848ed2..187c98ab298 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