summaryrefslogtreecommitdiffstats
path: root/tests/ui/pattern/usefulness/conflicting_bindings.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/pattern/usefulness/conflicting_bindings.stderr')
-rw-r--r--tests/ui/pattern/usefulness/conflicting_bindings.stderr66
1 files changed, 66 insertions, 0 deletions
diff --git a/tests/ui/pattern/usefulness/conflicting_bindings.stderr b/tests/ui/pattern/usefulness/conflicting_bindings.stderr
new file mode 100644
index 000000000..679fc83e7
--- /dev/null
+++ b/tests/ui/pattern/usefulness/conflicting_bindings.stderr
@@ -0,0 +1,66 @@
+error: cannot borrow value as mutable more than once at a time
+ --> $DIR/conflicting_bindings.rs:5:9
+ |
+LL | let ref mut y @ ref mut z = x;
+ | ^^^^^^^^^ --------- value is mutably borrowed by `z` here
+ | |
+ | value is mutably borrowed by `y` here
+
+error: cannot borrow value as mutable more than once at a time
+ --> $DIR/conflicting_bindings.rs:7:14
+ |
+LL | let Some(ref mut y @ ref mut z) = x else { return };
+ | ^^^^^^^^^ --------- value is mutably borrowed by `z` here
+ | |
+ | value is mutably borrowed by `y` here
+
+error: cannot borrow value as mutable more than once at a time
+ --> $DIR/conflicting_bindings.rs:9:17
+ |
+LL | if let Some(ref mut y @ ref mut z) = x {}
+ | ^^^^^^^^^ --------- value is mutably borrowed by `z` here
+ | |
+ | value is mutably borrowed by `y` here
+
+error: cannot borrow value as mutable more than once at a time
+ --> $DIR/conflicting_bindings.rs:11:17
+ |
+LL | if let Some(ref mut y @ ref mut z) = x && true {}
+ | ^^^^^^^^^ --------- value is mutably borrowed by `z` here
+ | |
+ | value is mutably borrowed by `y` here
+
+error: cannot borrow value as mutable more than once at a time
+ --> $DIR/conflicting_bindings.rs:13:20
+ |
+LL | while let Some(ref mut y @ ref mut z) = x {}
+ | ^^^^^^^^^ --------- value is mutably borrowed by `z` here
+ | |
+ | value is mutably borrowed by `y` here
+
+error: cannot borrow value as mutable more than once at a time
+ --> $DIR/conflicting_bindings.rs:15:20
+ |
+LL | while let Some(ref mut y @ ref mut z) = x && true {}
+ | ^^^^^^^^^ --------- value is mutably borrowed by `z` here
+ | |
+ | value is mutably borrowed by `y` here
+
+error: cannot borrow value as mutable more than once at a time
+ --> $DIR/conflicting_bindings.rs:18:9
+ |
+LL | ref mut y @ ref mut z => {}
+ | ^^^^^^^^^ --------- value is mutably borrowed by `z` here
+ | |
+ | value is mutably borrowed by `y` here
+
+error: cannot borrow value as mutable more than once at a time
+ --> $DIR/conflicting_bindings.rs:21:24
+ |
+LL | () if let Some(ref mut y @ ref mut z) = x => {}
+ | ^^^^^^^^^ --------- value is mutably borrowed by `z` here
+ | |
+ | value is mutably borrowed by `y` here
+
+error: aborting due to 8 previous errors
+