summaryrefslogtreecommitdiffstats
path: root/tests/ui/borrowck/borrowck-bad-nested-calls-free.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/borrowck/borrowck-bad-nested-calls-free.stderr')
-rw-r--r--tests/ui/borrowck/borrowck-bad-nested-calls-free.stderr23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/ui/borrowck/borrowck-bad-nested-calls-free.stderr b/tests/ui/borrowck/borrowck-bad-nested-calls-free.stderr
new file mode 100644
index 000000000..e273a778f
--- /dev/null
+++ b/tests/ui/borrowck/borrowck-bad-nested-calls-free.stderr
@@ -0,0 +1,23 @@
+error[E0502]: cannot borrow `a` as mutable because it is also borrowed as immutable
+ --> $DIR/borrowck-bad-nested-calls-free.rs:25:17
+ |
+LL | add(
+ | --- immutable borrow later used by call
+LL | &*a,
+ | --- immutable borrow occurs here
+LL | rewrite(&mut a));
+ | ^^^^^^ mutable borrow occurs here
+
+error[E0502]: cannot borrow `a` as mutable because it is also borrowed as immutable
+ --> $DIR/borrowck-bad-nested-calls-free.rs:32:17
+ |
+LL | add(
+ | --- immutable borrow later used by call
+LL | &*a,
+ | --- immutable borrow occurs here
+LL | rewrite(&mut a));
+ | ^^^^^^ mutable borrow occurs here
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0502`.