From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- .../unboxed-closures-borrow-conflict.stderr | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 tests/ui/unboxed-closures/unboxed-closures-borrow-conflict.stderr (limited to 'tests/ui/unboxed-closures/unboxed-closures-borrow-conflict.stderr') diff --git a/tests/ui/unboxed-closures/unboxed-closures-borrow-conflict.stderr b/tests/ui/unboxed-closures/unboxed-closures-borrow-conflict.stderr new file mode 100644 index 000000000..21d6b4fde --- /dev/null +++ b/tests/ui/unboxed-closures/unboxed-closures-borrow-conflict.stderr @@ -0,0 +1,15 @@ +error[E0503]: cannot use `x` because it was mutably borrowed + --> $DIR/unboxed-closures-borrow-conflict.rs:9:14 + | +LL | let f = || x += 1; + | -- - borrow occurs due to use of `x` in closure + | | + | borrow of `x` occurs here +LL | let _y = x; + | ^ use of borrowed `x` +LL | f; + | - borrow later used here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0503`. -- cgit v1.2.3