madsim-rs / madsim

Magical Deterministic Simulator for distributed systems in Rust.
Apache License 2.0
644 stars 46 forks source link

fix(time): fix panic cause by std internal structure change #88

Closed wangrunji0408 closed 1 year ago

wangrunji0408 commented 1 year ago

https://github.com/rust-lang/rust/pull/102368 (nightly-2022-09-29) changed the memory layout of std::time::{SystemTime, Instant} on Linux (code), making them no longer equal to libc::timespec. So the previous transmute between these types will break data and trigger a panic.

This PR fixes this issue and releases v0.2.9.