summaryrefslogtreecommitdiffstats
path: root/tests/ui/nll/issue-57100.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:03 +0000
commit64d98f8ee037282c35007b64c2649055c56af1db (patch)
tree5492bcf97fce41ee1c0b1cc2add283f3e66cdab0 /tests/ui/nll/issue-57100.stderr
parentAdding debian version 1.67.1+dfsg1-1. (diff)
downloadrustc-64d98f8ee037282c35007b64c2649055c56af1db.tar.xz
rustc-64d98f8ee037282c35007b64c2649055c56af1db.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/nll/issue-57100.stderr')
-rw-r--r--tests/ui/nll/issue-57100.stderr31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/ui/nll/issue-57100.stderr b/tests/ui/nll/issue-57100.stderr
new file mode 100644
index 000000000..523c3e8d0
--- /dev/null
+++ b/tests/ui/nll/issue-57100.stderr
@@ -0,0 +1,31 @@
+error[E0502]: cannot borrow `r.r2_union.f3_union` (via `r.r2_union.f3_union.s2_leaf.l1_u8`) as immutable because it is also borrowed as mutable (via `r.r2_union.f3_union.s1_leaf.l1_u8`)
+ --> $DIR/issue-57100.rs:42:20
+ |
+LL | let mref = &mut r.r2_union.f3_union.s1_leaf.l1_u8;
+ | -------------------------------------- mutable borrow occurs here (via `r.r2_union.f3_union.s1_leaf.l1_u8`)
+...
+LL | let nref = &r.r2_union.f3_union.s2_leaf.l1_u8;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ immutable borrow of `r.r2_union.f3_union.s2_leaf.l1_u8` -- which overlaps with `r.r2_union.f3_union.s1_leaf.l1_u8` -- occurs here
+...
+LL | println!("{} {}", mref, nref)
+ | ---- mutable borrow later used here
+ |
+ = note: `r.r2_union.f3_union.s2_leaf.l1_u8` is a field of the union `Second`, so it overlaps the field `r.r2_union.f3_union.s1_leaf.l1_u8`
+
+error[E0502]: cannot borrow `r.r2_union` (via `r.r2_union.f1_leaf.l1_u8`) as immutable because it is also borrowed as mutable (via `r.r2_union.f2_leaf.l1_u8`)
+ --> $DIR/issue-57100.rs:60:20
+ |
+LL | let mref = &mut r.r2_union.f2_leaf.l1_u8;
+ | ----------------------------- mutable borrow occurs here (via `r.r2_union.f2_leaf.l1_u8`)
+...
+LL | let nref = &r.r2_union.f1_leaf.l1_u8;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ immutable borrow of `r.r2_union.f1_leaf.l1_u8` -- which overlaps with `r.r2_union.f2_leaf.l1_u8` -- occurs here
+...
+LL | println!("{} {}", mref, nref)
+ | ---- mutable borrow later used here
+ |
+ = note: `r.r2_union.f1_leaf.l1_u8` is a field of the union `First`, so it overlaps the field `r.r2_union.f2_leaf.l1_u8`
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0502`.