diff options
Diffstat (limited to 'tests/ui/async-await/in-trait/async-generics-and-bounds.rs')
-rw-r--r-- | tests/ui/async-await/in-trait/async-generics-and-bounds.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/ui/async-await/in-trait/async-generics-and-bounds.rs b/tests/ui/async-await/in-trait/async-generics-and-bounds.rs new file mode 100644 index 000000000..a73d55adf --- /dev/null +++ b/tests/ui/async-await/in-trait/async-generics-and-bounds.rs @@ -0,0 +1,21 @@ +// check-fail +// known-bug: #102682 +// edition: 2021 + +#![feature(async_fn_in_trait)] +#![allow(incomplete_features)] + +use std::fmt::Debug; +use std::hash::Hash; + +trait MyTrait<T, U> { + async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash; +} + +impl<T, U> MyTrait<T, U> for (T, U) { + async fn foo(&self) -> &(T, U) { + self + } +} + +fn main() {} |