mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 20:33:54 -06:00
rust: add IsA bounds to QOM implementation traits
Check that the right bounds are provided to the qom_isa! macro whenever the class is defined to implement a certain class. This removes the need to add IsA<> bounds together with the *Impl trait bounds. Reviewed-by: Zhao Liu <zhao1.liu@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
646140dfeb
commit
ac5699c5da
2 changed files with 4 additions and 2 deletions
|
@ -86,7 +86,7 @@ unsafe extern "C" fn rust_resettable_exit_fn<T: ResettablePhasesImpl>(
|
|||
}
|
||||
|
||||
/// Trait providing the contents of [`DeviceClass`].
|
||||
pub trait DeviceImpl: ObjectImpl + ResettablePhasesImpl {
|
||||
pub trait DeviceImpl: ObjectImpl + ResettablePhasesImpl + IsA<DeviceState> {
|
||||
/// _Realization_ is the second stage of device creation. It contains
|
||||
/// all operations that depend on device properties and can fail (note:
|
||||
/// this is not yet supported for Rust devices).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue