diff options
Diffstat (limited to 'tests/ui/generic-associated-types/issue-90014.rs')
-rw-r--r-- | tests/ui/generic-associated-types/issue-90014.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/ui/generic-associated-types/issue-90014.rs b/tests/ui/generic-associated-types/issue-90014.rs new file mode 100644 index 000000000..55db95a6d --- /dev/null +++ b/tests/ui/generic-associated-types/issue-90014.rs @@ -0,0 +1,21 @@ +// edition:2018 + +#![feature(type_alias_impl_trait)] + +use std::future::Future; + +trait MakeFut { + type Fut<'a> where Self: 'a; + fn make_fut<'a>(&'a self) -> Self::Fut<'a>; +} + +impl MakeFut for &'_ mut () { + type Fut<'a> = impl Future<Output = ()>; + //~^ ERROR: the type `&mut ()` does not fulfill the required lifetime + + fn make_fut<'a>(&'a self) -> Self::Fut<'a> { + async { () } + } +} + +fn main() {} |