]> git.lizzy.rs Git - rust.git/blob - src/test/ui/type-alias-impl-trait/issue-55099-lifetime-inference.rs
Auto merge of #95454 - randomicon00:fix95444, r=wesleywiser
[rust.git] / src / test / ui / type-alias-impl-trait / issue-55099-lifetime-inference.rs
1 // check-pass
2 // Regression test for issue #55099
3 // Tests that we don't incorrectly consider a lifetime to part
4 // of the concrete type
5
6 #![feature(type_alias_impl_trait)]
7
8 trait Future {}
9
10 struct AndThen<F>(F);
11
12 impl<F> Future for AndThen<F> {}
13
14 struct Foo<'a> {
15     x: &'a mut (),
16 }
17
18 type F = impl Future;
19
20 impl<'a> Foo<'a> {
21     fn reply(&mut self) -> F {
22         AndThen(|| ())
23     }
24 }
25
26 fn main() {}