diff options
Diffstat (limited to 'tests/ui/type-alias-impl-trait/issue-55099-lifetime-inference.rs')
-rw-r--r-- | tests/ui/type-alias-impl-trait/issue-55099-lifetime-inference.rs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/ui/type-alias-impl-trait/issue-55099-lifetime-inference.rs b/tests/ui/type-alias-impl-trait/issue-55099-lifetime-inference.rs new file mode 100644 index 000000000..af0780ab0 --- /dev/null +++ b/tests/ui/type-alias-impl-trait/issue-55099-lifetime-inference.rs @@ -0,0 +1,26 @@ +// check-pass +// Regression test for issue #55099 +// Tests that we don't incorrectly consider a lifetime to part +// of the concrete type + +#![feature(type_alias_impl_trait)] + +trait Future {} + +struct AndThen<F>(F); + +impl<F> Future for AndThen<F> {} + +struct Foo<'a> { + x: &'a mut (), +} + +type F = impl Future; + +impl<'a> Foo<'a> { + fn reply(&mut self) -> F { + AndThen(|| ()) + } +} + +fn main() {} |