mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 16:54:01 +00:00
16 lines
284 B
Rust
16 lines
284 B
Rust
//@ 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
|
|
}
|