3 // pretty-expanded FIXME #23616
6 let _ = test(Some(0).into_iter());
12 fn parse(self, input: Self::Input) -> Result<(Self::Output, Self::Input), ()>;
13 fn chain<P>(self, p: P) -> Chain<Self, P> where Self: Sized {
18 struct Token<T>(#[allow(unused_tuple_struct_fields)] T::Item) where T: Iterator;
20 impl<T> Parser for Token<T> where T: Iterator {
22 type Output = T::Item;
23 fn parse(self, _input: Self::Input) -> Result<(Self::Output, Self::Input), ()> {
28 struct Chain<L, R>(#[allow(unused_tuple_struct_fields)] L, #[allow(unused_tuple_struct_fields)] R);
30 impl<L, R> Parser for Chain<L, R> where L: Parser, R: Parser<Input = L::Input> {
31 type Input = L::Input;
32 type Output = (L::Output, R::Output);
33 fn parse(self, _input: Self::Input) -> Result<(Self::Output, Self::Input), ()> {
38 fn test<I>(i: I) -> Result<((), I), ()> where I: Iterator<Item = i32> {
39 Chain(Token(0), Token(1))
40 .chain(Chain(Token(0), Token(1)))
41 .chain(Chain(Token(0), Token(1)))
42 .chain(Chain(Token(0), Token(1)))
43 .chain(Chain(Token(0), Token(1)))
44 .chain(Chain(Token(0), Token(1)))
45 .chain(Chain(Token(0), Token(1)))
46 .chain(Chain(Token(0), Token(1)))
47 .chain(Chain(Token(0), Token(1)))
49 .map(|(_, i)| ((), i))