summaryrefslogtreecommitdiffstats
path: root/src/test/ui/array-slice-vec/vec-mut-iter-borrow.stderr
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/array-slice-vec/vec-mut-iter-borrow.stderr14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/ui/array-slice-vec/vec-mut-iter-borrow.stderr b/src/test/ui/array-slice-vec/vec-mut-iter-borrow.stderr
new file mode 100644
index 000000000..0ec263c85
--- /dev/null
+++ b/src/test/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`.