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

2024-10-21 Thread Junjie Mao
Paolo Bonzini writes: > Il lun 21 ott 2024, 09:24 Junjie Mao ha scritto: > > > Thanks. I still prefer to keep the procedural macro code minimal, and > have the > > code generation in a separate macro, but this is a nice start! > > > > I'm not sure if I get your point right. > > My under

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

2024-10-21 Thread Paolo Bonzini
Il lun 21 ott 2024, 09:24 Junjie Mao ha scritto: > > Thanks. I still prefer to keep the procedural macro code minimal, and > have the > > code generation in a separate macro, but this is a nice start! > > > > I'm not sure if I get your point right. > > My understanding is that preferring minimiz

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

2024-10-21 Thread Junjie Mao
Paolo Bonzini writes: > On 10/21/24 07:40, Junjie Mao wrote: >> 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

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

2024-10-20 Thread Paolo Bonzini
On 10/21/24 07:40, Junjie Mao wrote: 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 jus

[PATCH] rust: introduce alternative implementation of offset_of!

2024-10-20 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