]> git.lizzy.rs Git - rust.git/blob - src/test/ui/type-alias-impl-trait/issue-57188-associate-impl-capture.rs
Loop over all opaque types instead of looking at just the first one with the same...
[rust.git] / src / test / ui / type-alias-impl-trait / issue-57188-associate-impl-capture.rs
1 // Regression test for #57188
2
3 // check-pass
4
5 // revisions: min_tait full_tait
6 #![feature(min_type_alias_impl_trait)]
7 #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
8 //[full_tait]~^ WARN incomplete
9
10 struct Baz<'a> {
11     source: &'a str,
12 }
13
14 trait Foo<'a> {
15     type T: Iterator<Item = Baz<'a>> + 'a;
16     fn foo(source: &'a str) -> Self::T;
17 }
18
19 struct Bar;
20 impl<'a> Foo<'a> for Bar {
21     type T = impl Iterator<Item = Baz<'a>> + 'a;
22     fn foo(source: &'a str) -> Self::T {
23         std::iter::once(Baz { source })
24     }
25 }
26
27 fn main() {}