1 error[E0277]: the trait bound `i32: std::convert::From<&str>` is not satisfied
2 --> $DIR/try-block-bad-type.rs:7:9
4 LL | Err("")?; //~ ERROR the trait bound `i32: std::convert::From<&str>` is not satisfied
5 | ^^^^^^^^ the trait `std::convert::From<&str>` is not implemented for `i32`
7 = help: the following implementations were found:
8 <i32 as std::convert::From<bool>>
9 <i32 as std::convert::From<core::num::NonZeroI32>>
10 <i32 as std::convert::From<i16>>
11 <i32 as std::convert::From<i8>>
13 = note: required by `std::convert::From::from`
15 error[E0271]: type mismatch resolving `<std::result::Result<i32, i32> as std::ops::Try>::Ok == &str`
16 --> $DIR/try-block-bad-type.rs:12:9
18 LL | "" //~ ERROR type mismatch
19 | ^^ expected i32, found &str
21 = note: expected type `i32`
24 error[E0271]: type mismatch resolving `<std::result::Result<i32, i32> as std::ops::Try>::Ok == ()`
25 --> $DIR/try-block-bad-type.rs:15:39
27 LL | let res: Result<i32, i32> = try { }; //~ ERROR type mismatch
28 | ^ expected i32, found ()
30 = note: expected type `i32`
33 error[E0277]: the trait bound `(): std::ops::Try` is not satisfied
34 --> $DIR/try-block-bad-type.rs:17:23
36 LL | let res: () = try { }; //~ the trait bound `(): std::ops::Try` is not satisfied
37 | ^^^ the trait `std::ops::Try` is not implemented for `()`
39 = note: required by `std::ops::Try::from_ok`
41 error[E0277]: the trait bound `i32: std::ops::Try` is not satisfied
42 --> $DIR/try-block-bad-type.rs:19:24
44 LL | let res: i32 = try { 5 }; //~ ERROR the trait bound `i32: std::ops::Try` is not satisfied
45 | ^^^^^ the trait `std::ops::Try` is not implemented for `i32`
47 = note: required by `std::ops::Try::from_ok`
49 error: aborting due to 5 previous errors
51 Some errors occurred: E0271, E0277.
52 For more information about an error, try `rustc --explain E0271`.