Function parser_combinators::unexpected [] [src]

pub fn unexpected<I, S>(message: S) -> Unexpected<I> where
    I: Stream,
    S: Into<Info<I::Item>>, 

Always fails with message as the error. Never consumes any input.

 let result = unexpected("token")
     .parse("a");
 assert!(result.is_err());
 assert!(result.err().unwrap().errors.iter().any(|m| *m == Error::Message("token".into())));