From f1679f7dd6330535cd2dbd0dd18ded0dc8a7e6d9 Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Tue, 29 Aug 2023 23:47:01 +0000 Subject: Capture lifetimes for associated type bounds destined to be lowered to opaques --- .../in-trait/lifetime-in-associated-trait-bound.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 tests/ui/impl-trait/in-trait/lifetime-in-associated-trait-bound.rs (limited to 'tests/ui/impl-trait') diff --git a/tests/ui/impl-trait/in-trait/lifetime-in-associated-trait-bound.rs b/tests/ui/impl-trait/in-trait/lifetime-in-associated-trait-bound.rs new file mode 100644 index 00000000000..49d36d6c99c --- /dev/null +++ b/tests/ui/impl-trait/in-trait/lifetime-in-associated-trait-bound.rs @@ -0,0 +1,19 @@ +// check-pass + +#![feature(associated_type_bounds, return_position_impl_trait_in_trait)] + +trait Trait { + type Type; + + fn method(&self) -> impl Trait; +} + +impl Trait for () { + type Type = (); + + fn method(&self) -> impl Trait { + () + } +} + +fn main() {} -- cgit 1.4.1-3-g733a5