]>
Commit | Line | Data |
---|---|---|
5869c6ff XL |
1 | struct QualifiedError<E>(E); |
2 | ||
3 | impl<E, T> From<E> for QualifiedError<T> | |
4 | where | |
5 | E: std::error::Error, | |
6 | T: From<E>, | |
7 | { | |
8 | fn from(e: E) -> QualifiedError<T> { | |
9 | QualifiedError(e.into()) | |
10 | } | |
11 | } | |
12 | ||
13 | fn infallible() -> Result<(), std::convert::Infallible> { | |
14 | Ok(()) | |
15 | } | |
16 | ||
17 | fn main() { | |
18 | let x = || -> Result<_, QualifiedError<_>> { | |
923072b8 FG |
19 | //~^ ERROR type annotations needed for `Result<(), QualifiedError<_>>` |
20 | infallible()?; | |
5869c6ff XL |
21 | Ok(()) |
22 | }; | |
23 | } |