rust/tests/ui/impl-trait/issue-102605.rs

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

16 lines
284 B
Rust
Raw Normal View History

2022-10-04 03:13:50 -05:00
//@ edition:2021
async fn foo() -> Result<(), String> {
Ok(())
}
fn convert_result<T, E>(r: Result<T, E>) -> Option<T> {
None
}
fn main() -> Option<()> {
//~^ ERROR `main` has invalid return type `Option<()>`
convert_result(foo())
//~^ ERROR mismatched types
}