From 520bd698602275d045bc518f38105c0924cc1718 Mon Sep 17 00:00:00 2001 From: Eric Holk Date: Tue, 25 Jan 2022 15:19:33 -0800 Subject: [PATCH] Add regression test for #93197 --- src/test/ui/async-await/issue-93197.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/test/ui/async-await/issue-93197.rs diff --git a/src/test/ui/async-await/issue-93197.rs b/src/test/ui/async-await/issue-93197.rs new file mode 100644 index 0000000000000..e1b220d365f18 --- /dev/null +++ b/src/test/ui/async-await/issue-93197.rs @@ -0,0 +1,15 @@ +// Regression test for #93197 +// build-pass +// edition:2021 + +#![feature(try_blocks)] + +use std::sync::{mpsc, mpsc::SendError}; + +pub async fn foo() { + let (tx, _) = mpsc::channel(); + + let _: Result<(), SendError<&str>> = try { tx.send("hello")?; }; +} + +fn main() {}