about summary refs log tree commit diff
path: root/tests/ui/type-alias-impl-trait/type-alias-nested-impl-trait.rs
blob: 20209c7b28c640ee6944b3fe393a6c60a35bcf2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//@ run-pass

#![feature(type_alias_impl_trait)]

use std::iter::{Chain, once};

type I<A> = Chain<A, impl Iterator<Item = &'static str>>;
#[define_opaque(I)]
fn test2<A: Iterator<Item = &'static str>>(x: A) -> I<A> {
    x.chain(once("5"))
}

fn main() {
    assert_eq!(vec!["1", "3", "5"], test2(["1", "3"].iter().cloned()).collect::<Vec<_>>());
}