bson-rust
bson-rust copied to clipboard
Time's "large-dates" feature should be optional
Hi,
when parsing a time::PrimitiveDateTime, the program's execution changes when the "large-dates" feature is enabled, due to some ambiguities when parsing a datetime.
bson has such feature enabled by default, thus potentially modifying how a program works.
In our case, we got some panics which we didn't know where they came from.
Would it be possible to remove the "large-dates" feature from time and perhaps make it optional?
We enable the large-dates feature because part of the bson test corpus includes dates in the Y10k+ range; I do think you make a good case for making that optional when it's guaranteed that inputs won't have years that large.
Unfortunately, removing the feature at this point would be a breaking change, so I've filed https://jira.mongodb.org/browse/RUST-1960 for it to be included in version 3.0 of the bson crate.
Updates: this is also getting addressed at https://github.com/time-rs/time/pull/709, which might provide you a solution which is not breaking
A new feature flag was added in #546 and will be released in 3.0, going to close this.