diff --git a/examples/custom_error.rs b/examples/custom_error.rs index 561920b7..8d5fb072 100644 --- a/examples/custom_error.rs +++ b/examples/custom_error.rs @@ -18,7 +18,6 @@ pub enum CustomError { impl ParserError for CustomError { type Inner = Self; - #[allow(deprecated)] fn from_input(input: &I) -> Self { CustomError::Winnow(input.clone()) } @@ -44,7 +43,6 @@ impl FromExtern for CustomError { #[inline] - #[allow(deprecated)] fn from_external_error(input: &I, e: E) -> Self { CustomError::External { cause: Box::new(e), diff --git a/src/combinator/branch.rs b/src/combinator/branch.rs index 5d3c01a1..5ad2cd88 100644 --- a/src/combinator/branch.rs +++ b/src/combinator/branch.rs @@ -144,7 +144,6 @@ impl, P: Parser> Alt Err(e.append(input, &start)), None => Err(ParserError::assert( @@ -173,7 +172,6 @@ impl, P: Parser> Alt for &mut } } - #[allow(deprecated)] match error { Some(e) => Err(e.append(input, &start)), None => Err(ParserError::assert( @@ -253,7 +251,6 @@ macro_rules! alt_trait_inner( } }); ($it:tt, $self:expr, $input:expr, $start:ident, $err:expr, $head:ident) => ({ - #[allow(deprecated)] Err($err.append($input, &$start)) }); ); @@ -307,7 +304,6 @@ macro_rules! permutation_trait_impl( if let Some(err) = err { // There are remaining parsers, and all errored on the remaining input input.reset(&start); -#[allow(deprecated)] return Err(err.append(input, &start)); } diff --git a/src/combinator/impls.rs b/src/combinator/impls.rs index c4cef40f..4b199e9c 100644 --- a/src/combinator/impls.rs +++ b/src/combinator/impls.rs @@ -94,7 +94,6 @@ where let o = self.parser.parse_next(input)?; let res = (self.map)(o).map_err(|err| { input.reset(&start); - #[allow(deprecated)] E::from_external_error(input, err) }); trace_result("verify", &res); diff --git a/src/combinator/multi.rs b/src/combinator/multi.rs index 89eb54e7..107e23f6 100644 --- a/src/combinator/multi.rs +++ b/src/combinator/multi.rs @@ -497,7 +497,6 @@ where E: ParserError, { let start = i.checkpoint(); - #[allow(deprecated)] match f.parse_next(i) { Err(e) => Err(e.append(i, &start)), Ok(o) => { @@ -555,7 +554,6 @@ where res.accumulate(o); } Err(e) => { - #[allow(deprecated)] return Err(e.append(i, &start)); } } @@ -596,7 +594,6 @@ where } Err(e) if e.is_backtrack() => { if count < min { - #[allow(deprecated)] return Err(e.append(input, &start)); } else { input.reset(&start); @@ -693,7 +690,6 @@ where Ok(o) => return Ok((res, o)), Err(e) if e.is_backtrack() => { i.reset(&start); - #[allow(deprecated)] match f.parse_next(i) { Err(e) => return Err(e.append(i, &start)), Ok(o) => { @@ -744,7 +740,6 @@ where res.accumulate(o); } Err(e) => { - #[allow(deprecated)] return Err(e.append(i, &start)); } } @@ -761,7 +756,6 @@ where i.reset(&start); match f.parse_next(i) { Err(e) => { - #[allow(deprecated)] return Err(e.append(i, &start)); } Ok(o) => { @@ -1053,7 +1047,6 @@ where let start = input.checkpoint(); match parser.parse_next(input) { Err(e) => { - #[allow(deprecated)] return Err(e.append(input, &start)); } Ok(o) => { @@ -1066,7 +1059,6 @@ where let len = input.eof_offset(); match separator.parse_next(input) { Err(e) => { - #[allow(deprecated)] return Err(e.append(input, &start)); } Ok(_) => { @@ -1080,7 +1072,6 @@ where match parser.parse_next(input) { Err(e) => { - #[allow(deprecated)] return Err(e.append(input, &start)); } Ok(o) => { @@ -1124,7 +1115,6 @@ where input.reset(&start); return Ok(acc); } else { - #[allow(deprecated)] return Err(e.append(input, &start)); } } @@ -1140,7 +1130,6 @@ where match separator.parse_next(input) { Err(e) if e.is_backtrack() => { if index < min { - #[allow(deprecated)] return Err(e.append(input, &start)); } else { input.reset(&start); @@ -1162,7 +1151,6 @@ where match parser.parse_next(input) { Err(e) if e.is_backtrack() => { if index < min { - #[allow(deprecated)] return Err(e.append(input, &start)); } else { input.reset(&start); @@ -1345,7 +1333,6 @@ where *elem = o; } Err(e) => { - #[allow(deprecated)] return Err(e.append(i, &start)); } } @@ -1411,7 +1398,6 @@ where { let init = init(); let start = input.checkpoint(); - #[allow(deprecated)] match f.parse_next(input) { Err(e) => Err(e.append(input, &start)), Ok(o1) => { @@ -1486,7 +1472,6 @@ where //FInputXMError: handle failure properly Err(err) if err.is_backtrack() => { if count < min { - #[allow(deprecated)] return Err(err.append(input, &start)); } else { input.reset(&start); @@ -1548,7 +1533,6 @@ where //FInputXMError: handle failure properly Err(err) if err.is_backtrack() => { if count < min { - #[allow(deprecated)] return Err(err.append(input, &start)); } else { input.reset(&start); @@ -1603,7 +1587,6 @@ where Ok(tmp) => acc = tmp, Err(e) => { input.reset(&start); - #[allow(deprecated)] let res = Err(E::from_external_error(input, e)); super::debug::trace_result("try_fold", &res); return res; @@ -1613,7 +1596,6 @@ where //FInputXMError: handle failure properly Err(err) if err.is_backtrack() => { if count < min { - #[allow(deprecated)] return Err(err.append(input, &start)); } else { input.reset(&start); diff --git a/src/combinator/tests.rs b/src/combinator/tests.rs index 5c97cdeb..fc1659e5 100644 --- a/src/combinator/tests.rs +++ b/src/combinator/tests.rs @@ -118,7 +118,6 @@ impl From for CustomError { impl ParserError for CustomError { type Inner = Self; - #[allow(deprecated)] fn from_input(_: &I) -> Self { CustomError } @@ -1306,12 +1305,10 @@ fn alt_test() { impl ParserError for ErrorStr { type Inner = Self; - #[allow(deprecated)] fn from_input(input: &I) -> Self { ErrorStr(format!("custom error message: ({input:?})")) } - #[allow(deprecated)] fn append(self, input: &I, _: &::Checkpoint) -> Self { ErrorStr(format!("custom error message: ({input:?}) - {self:?}")) } @@ -3426,7 +3423,6 @@ struct NilError; impl ParserError for NilError { type Inner = Self; - #[allow(deprecated)] fn from_input(_: &I) -> NilError { NilError } diff --git a/tests/testsuite/custom_errors.rs b/tests/testsuite/custom_errors.rs index b860643c..868b7eaf 100644 --- a/tests/testsuite/custom_errors.rs +++ b/tests/testsuite/custom_errors.rs @@ -4,7 +4,6 @@ use winnow::ascii::digit1 as digit; #[cfg(feature = "alloc")] use winnow::combinator::repeat; use winnow::combinator::terminated; -#[allow(deprecated)] use winnow::error::ParserError; use winnow::prelude::*; use winnow::stream::Stream; @@ -16,12 +15,10 @@ pub(crate) struct CustomError(String); impl<'a> ParserError> for CustomError { type Inner = Self; - #[allow(deprecated)] fn from_input(_: &Partial<&'a str>) -> Self { CustomError("error".to_owned()) } - #[allow(deprecated)] fn append(self, _: &Partial<&'a str>, _: & as Stream>::Checkpoint) -> Self { self }