4 ms·
> Partial borrow Yeah, that's the annoying part of Rust :( > I can't use my non-thread-safe classes in a lazy_static Well, you can, if you wrap them in Fragi
by floatboth 8y ago
> Partial borrow
Yeah, that's the annoying part of Rust :(
> I can't use my non-thread-safe classes in a lazy_static
Well, you can, if you wrap them in Fragile/Sticky from https://github.com/mitsuhiko/rust-fragile https://github.com/mitsuhiko/rust-fragile :)
> PhantomData is awkward, it absolutely sounds like something the compiler should handle, not the programmer
This is quite common in Haskell (called Proxy there), for different reasons (not for lifetimes since there are none — but for passing type-level stuff around calls), but because of that, it feels completely natural to me.