diff options
Diffstat (limited to 'tests/ui/impl-trait/in-trait/where-clause.rs')
-rw-r--r-- | tests/ui/impl-trait/in-trait/where-clause.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/ui/impl-trait/in-trait/where-clause.rs b/tests/ui/impl-trait/in-trait/where-clause.rs new file mode 100644 index 000000000..87bac519c --- /dev/null +++ b/tests/ui/impl-trait/in-trait/where-clause.rs @@ -0,0 +1,24 @@ +// check-pass +// edition: 2021 + +#![feature(return_position_impl_trait_in_trait)] +#![allow(incomplete_features)] + +use std::fmt::Debug; + +trait Foo<Item> { + fn foo<'a>(&'a self) -> impl Debug + where + Item: 'a; +} + +impl<Item, D: Debug + Clone> Foo<Item> for D { + fn foo<'a>(&'a self) -> impl Debug + where + Item: 'a, + { + self.clone() + } +} + +fn main() {} |