Re: [PATCH v2] rust: introduce alternative implementation of offset_of!

2024-10-22 Thread Paolo Bonzini
On 10/22/24 13:01, Junjie Mao wrote: Just noticed Paolo has a refreshed version in his v2 series. I like your improved error reporting actually. If (as will almost certainly be the case) there will be a v3, I will incorporate it. Paolo

Re: [PATCH v2] rust: introduce alternative implementation of offset_of!

2024-10-22 Thread Junjie Mao
Junjie Mao writes: > offset_of! was stabilized in Rust 1.77.0. Use an alternative implemenation > that was found on the Rust forums, and whose author agreed to license as > MIT for use in QEMU. > > The alternative allows only one level of field access, but apart from this > can be used just by

[PATCH v2] rust: introduce alternative implementation of offset_of!

2024-10-22 Thread Junjie Mao
offset_of! was stabilized in Rust 1.77.0. Use an alternative implemenation that was found on the Rust forums, and whose author agreed to license as MIT for use in QEMU. The alternative allows only one level of field access, but apart from this can be used just by replacing core::mem::offset_of! wi