]> git.lizzy.rs Git - rust.git/blob - src/test/ui/type-alias-impl-trait/type-alias-nested-impl-trait.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 / type-alias-nested-impl-trait.rs
1 // run-pass
2
3 // revisions: min_tait full_tait
4 #![feature(min_type_alias_impl_trait)]
5 #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
6 //[full_tait]~^ WARN incomplete
7
8 use std::iter::{once, Chain};
9
10 type I<A> = Chain<A, impl Iterator<Item = &'static str>>;
11 fn test2<A: Iterator<Item = &'static str>>(x: A) -> I<A> {
12     x.chain(once("5"))
13 }
14
15 fn main() {
16     assert_eq!(vec!["1", "3", "5"], test2(["1", "3"].iter().cloned()).collect::<Vec<_>>());
17 }