rust/tests/ui/inference/cannot-infer-partial-try-return.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
427 B
Rust
Raw Normal View History

struct QualifiedError<E>(E);
impl<E, T> From<E> for QualifiedError<T>
where
E: std::error::Error,
T: From<E>,
{
fn from(e: E) -> QualifiedError<T> {
QualifiedError(e.into())
}
}
fn infallible() -> Result<(), std::convert::Infallible> {
Ok(())
}
fn main() {
let x = || -> Result<_, QualifiedError<_>> {
2022-02-14 06:25:26 -06:00
infallible()?;
Ok(())
//~^ ERROR type annotations needed
};
}