diff options
Diffstat (limited to 'src/test/ui/impl-trait/issue-102605.rs')
-rw-r--r-- | src/test/ui/impl-trait/issue-102605.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/ui/impl-trait/issue-102605.rs b/src/test/ui/impl-trait/issue-102605.rs new file mode 100644 index 000000000..3bbdf35af --- /dev/null +++ b/src/test/ui/impl-trait/issue-102605.rs @@ -0,0 +1,15 @@ +// 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 +} |