1 error[E0277]: `?` couldn't convert the error to `i32`
2 --> $DIR/try-block-bad-type.rs:7:16
5 | ^ the trait `std::convert::From<&str>` is not implemented for `i32`
7 = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
8 = help: the following implementations were found:
9 <i32 as std::convert::From<bool>>
10 <i32 as std::convert::From<i16>>
11 <i32 as std::convert::From<i8>>
12 <i32 as std::convert::From<std::num::NonZeroI32>>
14 = note: required by `std::convert::From::from`
16 error[E0271]: type mismatch resolving `<std::result::Result<i32, i32> as std::ops::Try>::Ok == &str`
17 --> $DIR/try-block-bad-type.rs:12:9
20 | ^^ expected i32, found &str
22 = note: expected type `i32`
23 found reference `&str`
25 error[E0271]: type mismatch resolving `<std::result::Result<i32, i32> as std::ops::Try>::Ok == ()`
26 --> $DIR/try-block-bad-type.rs:15:39
28 LL | let res: Result<i32, i32> = try { };
29 | ^ expected i32, found ()
31 = note: expected type `i32`
34 error[E0277]: the trait bound `(): std::ops::Try` is not satisfied
35 --> $DIR/try-block-bad-type.rs:17:23
37 LL | let res: () = try { };
38 | ^^^ the trait `std::ops::Try` is not implemented for `()`
40 = note: required by `std::ops::Try::from_ok`
42 error[E0277]: the trait bound `i32: std::ops::Try` is not satisfied
43 --> $DIR/try-block-bad-type.rs:19:24
45 LL | let res: i32 = try { 5 };
46 | ^^^^^ the trait `std::ops::Try` is not implemented for `i32`
48 = note: required by `std::ops::Try::from_ok`
50 error: aborting due to 5 previous errors
52 Some errors have detailed explanations: E0271, E0277.
53 For more information about an error, try `rustc --explain E0271`.