diff options
Diffstat (limited to 'tests/ui/try-block')
-rw-r--r-- | tests/ui/try-block/try-block-bad-lifetime.stderr | 9 | ||||
-rw-r--r-- | tests/ui/try-block/try-block-maybe-bad-lifetime.stderr | 8 |
2 files changed, 9 insertions, 8 deletions
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 diff --git a/tests/ui/try-block/try-block-maybe-bad-lifetime.stderr b/tests/ui/try-block/try-block-maybe-bad-lifetime.stderr index f738b03ee..71c7e460c 100644 --- a/tests/ui/try-block/try-block-maybe-bad-lifetime.stderr +++ b/tests/ui/try-block/try-block-maybe-bad-lifetime.stderr @@ -2,10 +2,10 @@ error[E0506]: cannot assign to `i` because it is borrowed --> $DIR/try-block-maybe-bad-lifetime.rs:17:9 | LL | &i - | -- borrow of `i` occurs here + | -- `i` is borrowed here LL | }; LL | i = 0; - | ^^^^^ assignment to borrowed `i` occurs here + | ^^^^^ `i` is assigned to here but it was already borrowed LL | let _ = i; LL | do_something_with(x); | - borrow later used here @@ -32,10 +32,10 @@ error[E0506]: cannot assign to `i` because it is borrowed --> $DIR/try-block-maybe-bad-lifetime.rs:40:9 | LL | j = &i; - | -- borrow of `i` occurs here + | -- `i` is borrowed here LL | }; LL | i = 0; - | ^^^^^ assignment to borrowed `i` occurs here + | ^^^^^ `i` is assigned to here but it was already borrowed LL | let _ = i; LL | do_something_with(j); | - borrow later used here |