Re: [PATCH 11/13] rust: make properties array immutable

2024-10-21 Thread Junjie Mao
Paolo Bonzini writes: > Now that device_class_set_props() takes a const pointer, the only part of > "define_property!" that needs to be non-const is the call to try_into(). > This in turn will only break if offset_of returns a value with the most > significant bit set (i.e. a struct size that i

[PATCH 11/13] rust: make properties array immutable

2024-10-18 Thread Paolo Bonzini
Now that device_class_set_props() takes a const pointer, the only part of "define_property!" that needs to be non-const is the call to try_into(). This in turn will only break if offset_of returns a value with the most significant bit set (i.e. a struct size that is >=2^31 or >= 2^63, respectively