Up until recently, this was a valid way to write a “Flatten” trait, to convert things to contiguous blocks of bytes that can be sent between processes. I didn’t use rustc-serialize because I couldn’t find a way to optimize the Vec<T> where T: Copy
case to a bulk memcpy
.
Unfortunately, despite the fact that this code is entirely unambiguous, and worked until about a week ago, the Rust type system intentfully no longer allows this. Any ideas for how I can rewrite these traits in a way that works with the latest rustc?