diff options
Diffstat (limited to 'tests/ui/async-await/try-in-sync.rs')
| -rw-r--r-- | tests/ui/async-await/try-in-sync.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/ui/async-await/try-in-sync.rs b/tests/ui/async-await/try-in-sync.rs new file mode 100644 index 00000000000..81d72c3fb9a --- /dev/null +++ b/tests/ui/async-await/try-in-sync.rs @@ -0,0 +1,9 @@ +//@ edition: 2021 + +async fn foo() -> Result<(), ()> { todo!() } + +fn main() -> Result<(), ()> { + foo()?; + //~^ ERROR the `?` operator can only be applied to values that implement `Try` + Ok(()) +} |
