1 error[E0597]: `my_string` does not live long enough
2 --> $DIR/try-block-bad-lifetime.rs:15:33
4 LL | let result: Result<(), &str> = try {
5 | ------ borrow later stored here
6 LL | let my_string = String::from("");
7 LL | let my_str: & str = & my_string;
8 | ^^^^^^^^^^^ borrowed value does not live long enough
11 | - `my_string` dropped here while still borrowed
13 error[E0506]: cannot assign to `i` because it is borrowed
14 --> $DIR/try-block-bad-lifetime.rs:29:13
17 | ------ borrow of `i` occurs here
20 | ^^^^^^ assignment to borrowed `i` occurs here
22 LL | ::std::mem::drop(k);
23 | - borrow later used here
25 error[E0382]: use of moved value: `k`
26 --> $DIR/try-block-bad-lifetime.rs:31:26
29 | - move occurs because `k` has type `&mut i32`, which does not implement the `Copy` trait
30 LL | let mut j: Result<(), &mut i32> = try {
34 LL | ::std::mem::drop(k);
35 | ^ value used here after move
37 error[E0506]: cannot assign to `i` because it is borrowed
38 --> $DIR/try-block-bad-lifetime.rs:32:9
41 | ------ borrow of `i` occurs here
44 | ^^^^^^ assignment to borrowed `i` occurs here
46 LL | let i_ptr = if let Err(i_ptr) = j { i_ptr } else { panic ! ("") };
47 | - borrow later used here
49 error: aborting due to 4 previous errors
51 Some errors have detailed explanations: E0382, E0506, E0597.
52 For more information about an error, try `rustc --explain E0382`.