Skip to content
This repository was archived by the owner on Nov 6, 2024. It is now read-only.

Commit 19357f4

Browse files
committed
fix: derive Default for kvm_xsave2
`FamStructWrapper<T>` imposes a bound of `Default + FamStruct` on `T`. However, it seems that when defining type aliases, Rust will not ensure this bound is met until the type alias is actually used (as in a function definition). This made the `Xsave` type defined in `x86_64/fam.rs` essentially "unmentionable", as any attempts as using it will result in a compile error. Fix this by deriving `Default` for it, and also derive `Debug` for consistency with other types. Signed-off-by: Patrick Roy <roypat@amazon.co.uk>
1 parent 2f2db3b commit 19357f4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/x86_64/fam_wrappers.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ pub type MsrList = FamStructWrapper<kvm_msr_list>;
9898
///
9999
/// See also: [`Xsave`].
100100
#[repr(C)]
101+
#[derive(Debug, Default)]
101102
pub struct kvm_xsave2 {
102103
pub len: usize,
103104
pub xsave: kvm_xsave,

0 commit comments

Comments
 (0)