1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
|
This patch is based on a revert of upstream commit
754769b8f5875e043e37158d7aaa1c12acb847da, adapted for use in the debian package
by Peter Michael Green.
Index: toml-edit/Cargo.toml
===================================================================
--- toml-edit.orig/Cargo.toml
+++ toml-edit/Cargo.toml
@@ -156,7 +156,7 @@ optional = true
version = "0.6.8"
[dependencies.winnow]
-version = "0.7.0"
+version = "0.6.0"
optional = true
[dev-dependencies.libtest-mimic]
diff --git toml_edit/src/parser/datetime.rs toml_edit/src/parser/datetime.rs
index 2030b5496f..b55bab121c 100644
--- toml_edit/src/parser/datetime.rs
+++ toml_edit/src/parser/datetime.rs
@@ -74,9 +74,13 @@ fn full_date_(input: &mut Input<'_>) -> ModalResult<Date> {
};
if max_days_in_month < day {
input.reset(&day_start);
- return Err(
- winnow::error::ErrMode::from_external_error(input, CustomError::OutOfRange).cut(),
- );
+ #[expect(deprecated)]
+ return Err(winnow::error::ErrMode::from_external_error(
+ input,
+ winnow::error::ErrorKind::Verify,
+ CustomError::OutOfRange,
+ )
+ .cut());
}
Ok(Date { year, month, day })
diff --git toml_edit/src/parser/mod.rs toml_edit/src/parser/mod.rs
index 6c71a1160e..92c22e9ab1 100644
--- toml_edit/src/parser/mod.rs
+++ toml_edit/src/parser/mod.rs
@@ -139,10 +139,15 @@ pub(crate) mod prelude {
mut parser: impl ModalParser<Input<'b>, O, ContextError>,
) -> impl ModalParser<Input<'b>, O, ContextError> {
move |input: &mut Input<'b>| {
- input
- .state
- .enter()
- .map_err(|err| winnow::error::ErrMode::from_external_error(input, err).cut())?;
+ input.state.enter().map_err(|err| {
+ #[allow(deprecated)]
+ winnow::error::ErrMode::from_external_error(
+ input,
+ winnow::error::ErrorKind::Eof,
+ err,
+ )
+ .cut()
+ })?;
let result = parser.parse_next(input);
input.state.exit();
result
diff --git toml_edit/src/parser/trivia.rs toml_edit/src/parser/trivia.rs
index 8597e8cdd0..7f5768d6ee 100644
--- toml_edit/src/parser/trivia.rs
+++ toml_edit/src/parser/trivia.rs
@@ -9,6 +9,7 @@ use winnow::combinator::peek;
use winnow::combinator::repeat;
use winnow::combinator::terminated;
use winnow::prelude::*;
+use winnow::stream::Stream as _;
use winnow::token::any;
use winnow::token::one_of;
use winnow::token::take_while;
|