Closed mariari closed 1 year ago
Without looking over your code (it appears to be far from a minimal example), I am certain that this is the intended behavior. This is wholly unrelated to #514, which was actually filed in error, and #384 is somewhat along the right track.
Ultimately this traces back quite a ways to #307. If you look there, I initially resolved in favor of option 4, as I was unaware of a manner to resolve the potential conflict once tzdb is supported. However, a few months ago I ran across a solution (not relevant here), which led me to reconsider that decision. As such I changed the internal representation to option 3 in that issue. There are significant advantages. For end users, everything is significantly faster. For me, it will allow me (in a few weeks when MSRV permits) merge the internal representation of PrimitiveDateTime
and OffsetDateTime
, reducing the duplication between them by a fair amount.
Generally speaking, if you're up against the bounds of what is considered valid, panics aren't unexpected.
I have some rust code that reliably produces
local datetime out of valid range error
It seems it may be related to #384 and #514. This is reproducible for versions
0.3.13
all the way up to0.3.16
oddly enough0.3.11
is fine.Code that Reproduced the error
the following code was made to create the error
The error causing lines
It seems the call in
try_from
, namelyt.to_offset
caused the error.Error Message