mirror of https://github.com/rust-lang/rust
17 lines
364 B
Rust
17 lines
364 B
Rust
//@ check-pass
|
|
|
|
#![feature(type_alias_impl_trait)]
|
|
|
|
use std::iter::{once, Chain};
|
|
|
|
fn test1<A: Iterator<Item = &'static str>>(x: A) -> Chain<A, impl Iterator<Item = &'static str>> {
|
|
x.chain(once(","))
|
|
}
|
|
|
|
type I<A> = Chain<A, impl Iterator<Item = &'static str>>;
|
|
fn test2<A: Iterator<Item = &'static str>>(x: A) -> I<A> {
|
|
x.chain(once(","))
|
|
}
|
|
|
|
fn main() {}
|