From 64d98f8ee037282c35007b64c2649055c56af1db Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:03 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- tests/ui/methods/method-self-arg-2.stderr | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/ui/methods/method-self-arg-2.stderr (limited to 'tests/ui/methods/method-self-arg-2.stderr') diff --git a/tests/ui/methods/method-self-arg-2.stderr b/tests/ui/methods/method-self-arg-2.stderr new file mode 100644 index 000000000..b98f7a786 --- /dev/null +++ b/tests/ui/methods/method-self-arg-2.stderr @@ -0,0 +1,24 @@ +error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable + --> $DIR/method-self-arg-2.rs:15:14 + | +LL | let y = &mut x; + | ------ mutable borrow occurs here +LL | Foo::bar(&x); + | ^^ immutable borrow occurs here +LL | y.use_mut(); + | ----------- mutable borrow later used here + +error[E0499]: cannot borrow `x` as mutable more than once at a time + --> $DIR/method-self-arg-2.rs:20:14 + | +LL | let y = &mut x; + | ------ first mutable borrow occurs here +LL | Foo::baz(&mut x); + | ^^^^^^ second mutable borrow occurs here +LL | y.use_mut(); + | ----------- first borrow later used here + +error: aborting due to 2 previous errors + +Some errors have detailed explanations: E0499, E0502. +For more information about an error, try `rustc --explain E0499`. -- cgit v1.2.3