]> git.lizzy.rs Git - rust.git/blob - src/test/ui/catch/catch-bad-type.stderr
Rollup merge of #53317 - estebank:abolish-ice, r=oli-obk
[rust.git] / src / test / ui / catch / catch-bad-type.stderr
1 error[E0277]: the trait bound `i32: std::convert::From<&str>` is not satisfied
2   --> $DIR/catch-bad-type.rs:15:9
3    |
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`
6    |
7    = help: the following implementations were found:
8              <i32 as std::convert::From<bool>>
9              <i32 as std::convert::From<i16>>
10              <i32 as std::convert::From<i8>>
11              <i32 as std::convert::From<u16>>
12              <i32 as std::convert::From<u8>>
13    = note: required by `std::convert::From::from`
14
15 error[E0271]: type mismatch resolving `<std::result::Result<i32, i32> as std::ops::Try>::Ok == &str`
16   --> $DIR/catch-bad-type.rs:20:9
17    |
18 LL |         "" //~ ERROR type mismatch
19    |         ^^ expected i32, found &str
20    |
21    = note: expected type `i32`
22               found type `&str`
23
24 error[E0271]: type mismatch resolving `<std::result::Result<i32, i32> as std::ops::Try>::Ok == ()`
25   --> $DIR/catch-bad-type.rs:23:44
26    |
27 LL |     let res: Result<i32, i32> = do catch { }; //~ ERROR type mismatch
28    |                                            ^ expected i32, found ()
29    |
30    = note: expected type `i32`
31               found type `()`
32
33 error[E0277]: the trait bound `(): std::ops::Try` is not satisfied
34   --> $DIR/catch-bad-type.rs:25:28
35    |
36 LL |     let res: () = do catch { }; //~ the trait bound `(): std::ops::Try` is not satisfied
37    |                            ^^^ the trait `std::ops::Try` is not implemented for `()`
38    |
39    = note: required by `std::ops::Try::from_ok`
40
41 error[E0277]: the trait bound `i32: std::ops::Try` is not satisfied
42   --> $DIR/catch-bad-type.rs:27:29
43    |
44 LL |     let res: i32 = do catch { 5 }; //~ ERROR the trait bound `i32: std::ops::Try` is not satisfied
45    |                             ^^^^^ the trait `std::ops::Try` is not implemented for `i32`
46    |
47    = note: required by `std::ops::Try::from_ok`
48
49 error: aborting due to 5 previous errors
50
51 Some errors occurred: E0271, E0277.
52 For more information about an error, try `rustc --explain E0271`.