diff options
| author | Michael Goulet <michael@errs.io> | 2023-08-29 23:47:01 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2023-08-30 00:31:00 +0000 |
| commit | f1679f7dd6330535cd2dbd0dd18ded0dc8a7e6d9 (patch) | |
| tree | 10b7379f1505746303d7367db72c62fd5e0782c9 /tests/ui/impl-trait | |
| parent | b2515fa741eea89b82a2c94048f934bbcbd3bd48 (diff) | |
| download | rust-f1679f7dd6330535cd2dbd0dd18ded0dc8a7e6d9.tar.gz rust-f1679f7dd6330535cd2dbd0dd18ded0dc8a7e6d9.zip | |
Capture lifetimes for associated type bounds destined to be lowered to opaques
Diffstat (limited to 'tests/ui/impl-trait')
| -rw-r--r-- | tests/ui/impl-trait/in-trait/lifetime-in-associated-trait-bound.rs | 19 |
1 files changed, 19 insertions, 0 deletions
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<Type: '_>; +} + +impl Trait for () { + type Type = (); + + fn method(&self) -> impl Trait<Type: '_> { + () + } +} + +fn main() {} |
