Lets imagine Instant::now() is a U8 for simplicity, we are at tick 250, and set a timeout of 10tick.
After 6 tick the Instant::now() overflow and return 0, causing the timeout to trigger 4 tick in advance.
afaik the proper way to handle overflow is
if Instant::now() - start > timeout {
}
this will fail only if this check is done less often than Instant overflow, at that point i don't think there is much that can be done, and was a failure case anyway
Instant is 64 bits, precsiely to allow code to assume it never overflows. It's unlikely we'll ever add support for smaller Instants because the space savings aren't worth the footguns for most code.
the proposed way to check for timeout seems to not work properly when Instant::now() overflow after saving deadline.
Lets imagine Instant::now() is a U8 for simplicity, we are at tick 250, and set a timeout of 10tick. After 6 tick the Instant::now() overflow and return 0, causing the timeout to trigger 4 tick in advance.
afaik the proper way to handle overflow is
this will fail only if this check is done less often than Instant overflow, at that point i don't think there is much that can be done, and was a failure case anyway