1 error[E0506]: cannot assign to `i` because it is borrowed
2 --> $DIR/try-block-maybe-bad-lifetime.rs:17:9
5 | -- borrow of `i` occurs here
8 | ^^^^^ assignment to borrowed `i` occurs here
10 LL | do_something_with(x);
11 | - borrow later used here
13 error[E0382]: borrow of moved value: `x`
14 --> $DIR/try-block-maybe-bad-lifetime.rs:28:24
16 LL | let x = String::new();
17 | - move occurs because `x` has type `String`, which does not implement the `Copy` trait
19 LL | ::std::mem::drop(x);
22 LL | println!("{}", x);
23 | ^ value borrowed here after move
25 = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
26 help: consider cloning the value if the performance cost is acceptable
28 LL | ::std::mem::drop(x.clone());
31 error[E0506]: cannot assign to `i` because it is borrowed
32 --> $DIR/try-block-maybe-bad-lifetime.rs:40:9
35 | -- borrow of `i` occurs here
38 | ^^^^^ assignment to borrowed `i` occurs here
40 LL | do_something_with(j);
41 | - borrow later used here
43 error: aborting due to 3 previous errors
45 Some errors have detailed explanations: E0382, E0506.
46 For more information about an error, try `rustc --explain E0382`.