From 2e789b9f0dd4d288e09881c1152f30a9fb456f75 Mon Sep 17 00:00:00 2001 From: Tyler Mandry Date: Sun, 5 May 2019 17:23:47 -0700 Subject: [PATCH] Add test for #59972 --- src/test/run-pass/generator/issue-59972.rs | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/test/run-pass/generator/issue-59972.rs diff --git a/src/test/run-pass/generator/issue-59972.rs b/src/test/run-pass/generator/issue-59972.rs new file mode 100644 index 00000000000..995da4fb3ff --- /dev/null +++ b/src/test/run-pass/generator/issue-59972.rs @@ -0,0 +1,23 @@ +// compile-flags: --edition=2018 + +#![feature(async_await, await_macro)] + +pub enum Uninhabited { } + +fn uninhabited_async() -> Uninhabited { + unreachable!() +} + +async fn noop() { } + +#[allow(unused)] +async fn contains_never() { + let error = uninhabited_async(); + await!(noop()); + let error2 = error; +} + +#[allow(unused_must_use)] +fn main() { + contains_never(); +}