From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- .../borrowck/borrowck-anon-fields-variant.stderr | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/test/ui/borrowck/borrowck-anon-fields-variant.stderr (limited to 'src/test/ui/borrowck/borrowck-anon-fields-variant.stderr') diff --git a/src/test/ui/borrowck/borrowck-anon-fields-variant.stderr b/src/test/ui/borrowck/borrowck-anon-fields-variant.stderr new file mode 100644 index 000000000..98f6f00a7 --- /dev/null +++ b/src/test/ui/borrowck/borrowck-anon-fields-variant.stderr @@ -0,0 +1,40 @@ +error[E0503]: cannot use `y` because it was mutably borrowed + --> $DIR/borrowck-anon-fields-variant.rs:16:19 + | +LL | Foo::Y(ref mut a, _) => a, + | --------- borrow of `y.0` occurs here +... +LL | let b = match y { + | ^ use of borrowed `y.0` +... +LL | *a += 1; + | ------- borrow later used here + +error[E0503]: cannot use `y` because it was mutably borrowed + --> $DIR/borrowck-anon-fields-variant.rs:34:19 + | +LL | Foo::Y(ref mut a, _) => a, + | --------- borrow of `y.0` occurs here +... +LL | let b = match y { + | ^ use of borrowed `y.0` +... +LL | *a += 1; + | ------- borrow later used here + +error[E0499]: cannot borrow `y.0` as mutable more than once at a time + --> $DIR/borrowck-anon-fields-variant.rs:36:14 + | +LL | Foo::Y(ref mut a, _) => a, + | --------- first mutable borrow occurs here +... +LL | Foo::Y(ref mut b, _) => b, + | ^^^^^^^^^ second mutable borrow occurs here +... +LL | *a += 1; + | ------- first borrow later used here + +error: aborting due to 3 previous errors + +Some errors have detailed explanations: E0499, E0503. +For more information about an error, try `rustc --explain E0499`. -- cgit v1.2.3