1 error[E0277]: `?` couldn't convert the error to `TryFromSliceError`
2 --> $DIR/try-block-bad-type.rs:7:16
5 | ^ the trait `From<&str>` is not implemented for `TryFromSliceError`
7 = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
8 = help: the trait `From<Infallible>` is implemented for `TryFromSliceError`
9 = note: required for `Result<u32, TryFromSliceError>` to implement `FromResidual<Result<Infallible, &str>>`
11 error[E0271]: type mismatch resolving `<Result<i32, i32> as Try>::Output == &str`
12 --> $DIR/try-block-bad-type.rs:12:9
15 | ^^ expected `i32`, found `&str`
17 error[E0271]: type mismatch resolving `<Result<i32, i32> as Try>::Output == ()`
18 --> $DIR/try-block-bad-type.rs:15:39
20 LL | let res: Result<i32, i32> = try { };
21 | ^ expected `i32`, found `()`
23 error[E0277]: a `try` block must return `Result` or `Option` (or another type that implements `Try`)
24 --> $DIR/try-block-bad-type.rs:17:25
26 LL | let res: () = try { };
27 | ^ could not wrap the final value of the block as `()` doesn't implement `Try`
29 = help: the trait `Try` is not implemented for `()`
31 error[E0277]: a `try` block must return `Result` or `Option` (or another type that implements `Try`)
32 --> $DIR/try-block-bad-type.rs:20:26
34 LL | let res: i32 = try { 5 };
35 | ^ could not wrap the final value of the block as `i32` doesn't implement `Try`
37 = help: the trait `Try` is not implemented for `i32`
39 error: aborting due to 5 previous errors
41 Some errors have detailed explanations: E0271, E0277.
42 For more information about an error, try `rustc --explain E0271`.