Closed shinmao closed 1 year ago
Hi, heuristic-research
crate, as name suggests, is experimental crate to check some ideas. It is not used by the VRP solver itself and never will be. So, I accept some unsafe code here if it helps to simplify implementation a lot.
https://github.com/reinterpretcat/vrp/blob/b06c714f4598dad70b2410fb6fa8f0798d559efb/experiments/heuristic-research/src/solver/proxies.rs#L37-L51 Implementation with reference
transmute
are unsound at line 44 and line 51. If we transmute reference, we need to guarantee the layout of types by ourselves. None of trait bound onS
can make a safe guarantee. Even line 42 and line 49 can check the same type id, we still can't guaranteestruct
instances with same definition have same layout becauserepr(Rust)
is not specified representation.