From 9793abc2092ab37e406a07b8e35bfaf5a9e26fe6 Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Wed, 18 Jan 2023 18:11:19 +0000 Subject: [PATCH] Add test --- tests/ui/async-await/auxiliary/issue-107036.rs | 12 ++++++++++++ tests/ui/async-await/issue-107036.rs | 14 ++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 tests/ui/async-await/auxiliary/issue-107036.rs create mode 100644 tests/ui/async-await/issue-107036.rs diff --git a/tests/ui/async-await/auxiliary/issue-107036.rs b/tests/ui/async-await/auxiliary/issue-107036.rs new file mode 100644 index 00000000000..c3f6141b284 --- /dev/null +++ b/tests/ui/async-await/auxiliary/issue-107036.rs @@ -0,0 +1,12 @@ +// edition:2021 + +pub trait T {} +impl T for () {} + +pub struct S {} + +impl S { + pub async fn f<'a>(&self) -> impl T + 'a { + () + } +} diff --git a/tests/ui/async-await/issue-107036.rs b/tests/ui/async-await/issue-107036.rs new file mode 100644 index 00000000000..6a22de2c943 --- /dev/null +++ b/tests/ui/async-await/issue-107036.rs @@ -0,0 +1,14 @@ +// aux-build:issue-107036.rs +// edition:2021 +// check-pass + +extern crate issue_107036; +use issue_107036::S; + +async fn f() { + S{}.f().await; +} + +fn main() { + let _ = f(); +}