about summary refs log tree commit diff
path: root/tests/ui/array-slice-vec/vec-mut-iter-borrow.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/array-slice-vec/vec-mut-iter-borrow.stderr')
-rw-r--r--tests/ui/array-slice-vec/vec-mut-iter-borrow.stderr14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/ui/array-slice-vec/vec-mut-iter-borrow.stderr b/tests/ui/array-slice-vec/vec-mut-iter-borrow.stderr
new file mode 100644
index 00000000000..0ec263c850e
--- /dev/null
+++ b/tests/ui/array-slice-vec/vec-mut-iter-borrow.stderr
@@ -0,0 +1,14 @@
+error[E0499]: cannot borrow `xs` as mutable more than once at a time
+  --> $DIR/vec-mut-iter-borrow.rs:5:9
+   |
+LL |     for x in &mut xs {
+   |              -------
+   |              |
+   |              first mutable borrow occurs here
+   |              first borrow later used here
+LL |         xs.push(1)
+   |         ^^^^^^^^^^ second mutable borrow occurs here
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0499`.