From 3e3e70d529d8c7d7c4d7bc4fefc9f109393b9245 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:43 +0200 Subject: Merging upstream version 1.69.0+dfsg1. Signed-off-by: Daniel Baumann --- tests/ui/try-block/try-block-bad-lifetime.stderr | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'tests/ui/try-block/try-block-bad-lifetime.stderr') diff --git a/tests/ui/try-block/try-block-bad-lifetime.stderr b/tests/ui/try-block/try-block-bad-lifetime.stderr index ea079e30d..28941cb0a 100644 --- a/tests/ui/try-block/try-block-bad-lifetime.stderr +++ b/tests/ui/try-block/try-block-bad-lifetime.stderr @@ -4,6 +4,7 @@ error[E0597]: `my_string` does not live long enough LL | let result: Result<(), &str> = try { | ------ borrow later stored here LL | let my_string = String::from(""); + | --------- binding `my_string` declared here LL | let my_str: & str = & my_string; | ^^^^^^^^^^^ borrowed value does not live long enough ... @@ -14,10 +15,10 @@ error[E0506]: cannot assign to `i` because it is borrowed --> $DIR/try-block-bad-lifetime.rs:29:13 | LL | let k = &mut i; - | ------ borrow of `i` occurs here + | ------ `i` is borrowed here ... LL | i = 10; - | ^^^^^^ assignment to borrowed `i` occurs here + | ^^^^^^ `i` is assigned to here but it was already borrowed LL | }; LL | ::std::mem::drop(k); | - borrow later used here @@ -38,10 +39,10 @@ error[E0506]: cannot assign to `i` because it is borrowed --> $DIR/try-block-bad-lifetime.rs:32:9 | LL | let k = &mut i; - | ------ borrow of `i` occurs here + | ------ `i` is borrowed here ... LL | i = 40; - | ^^^^^^ assignment to borrowed `i` occurs here + | ^^^^^^ `i` is assigned to here but it was already borrowed LL | LL | let i_ptr = if let Err(i_ptr) = j { i_ptr } else { panic ! ("") }; | - borrow later used here -- cgit v1.2.3