Open Cinea4678 opened 2 months ago
Add: I just found modifying this function like below can fix my problem while keep tests passing. If you think it's fine, I'd be happy to organize it into a PR, or if there's a better way, we can discuss it together.
third_party/src/de.rs:274
fn deserialize_i64<V>(self, visitor: V) -> Result<V::Value>
where
V: de::Visitor<'de>,
{
let pair = self.pair.take().unwrap();
let span = pair.as_span();
let mut res = (move || if matches!(pair.as_rule(), Rule::number) && is_int(pair.as_str()) {
visitor.visit_i64(parse_integer(&pair)? as i64)
} else {
visitor.visit_i64(parse_number(&pair)? as i64)
})();
error::set_location(&mut res, &span);
res
}
I came across this by accident:
Above is a code snippet deserializing 1713749402391424255 into i64, and as it runs, it panicked because of assertion error:
Here is the version and my environment: