fn assert_required_cpu_features() {
    let cpuid = cpuid::CpuId::new();
    let fi = cpuid.get_feature_info();
    let has_apic = fi.as_ref().map_or(false, |f| f.has_apic());
    let has_x2apic = fi.as_ref().map_or(false, |f| f.has_x2apic());
    let has_tsc = fi.as_ref().map_or(false, |f| f.has_tsc());
    let has_syscalls = fi.as_ref().map_or(false, |f| f.has_sysenter_sysexit());
    let has_pae = fi.as_ref().map_or(false, |f| f.has_pae());
    let has_msr = fi.as_ref().map_or(false, |f| f.has_msr());

    let has_sse = fi.as_ref().map_or(false, |f| f.has_sse());
    let has_sse3 = fi.as_ref().map_or(false, |f| f.has_sse3());
    let _has_avx = fi.as_ref().map_or(false, |f| f.has_avx());
    let has_osfxsr = fi.as_ref().map_or(false, |f| f.has_fxsave_fxstor());

    assert!(has_tsc, "No RDTSC? Run on a more modern machine!");
    assert!(has_sse, "No SSE? Run on a more modern machine!");
    assert!(has_osfxsr, "No fxsave? Run on a more modern machine!");
    assert!(has_sse3, "No SSE3? Run on a more modern machine!"); //TBD

    //assert!(has_avx, "No AVX? Run on a more modern machine!");

    assert!(has_apic, "No APIC? Run on a more modern machine!");
    assert!(has_x2apic, "No X2APIC? Run on a more modern machine!");
    assert!(has_syscalls, "No sysenter? Run on a more modern machine!");
    assert!(has_pae, "No PAE? Run on a more modern machine!");
    assert!(has_msr, "No MSR? Run on a more modern machine!");
}
/// Make sure the machine supports what we require.
Make sure the machine supports what we require.
Make sure the machine supports what we require .
fn assert_required_cpu_features() {
    let cpuid = cpuid::CpuId::new();
    let fi = cpuid.get_feature_info();
    let has_apic = fi.as_ref().map_or(false, |f| f.has_apic());
    let has_x2apic = fi.as_ref().map_or(false, |f| f.has_x2apic());
    let has_tsc = fi.as_ref().map_or(false, |f| f.has_tsc());
    let has_syscalls = fi.as_ref().map_or(false, |f| f.has_sysenter_sysexit());
    let has_pae = fi.as_ref().map_or(false, |f| f.has_pae());
    let has_msr = fi.as_ref().map_or(false, |f| f.has_msr());
    let has_sse = fi.as_ref().map_or(false, |f| f.has_sse());
    let has_sse3 = fi.as_ref().map_or(false, |f| f.has_sse3());
    let _has_avx = fi.as_ref().map_or(false, |f| f.has_avx());
    let has_osfxsr = fi.as_ref().map_or(false, |f| f.has_fxsave_fxstor());
    assert!(has_tsc, "No RDTSC? Run on a more modern machine!");
    assert!(has_sse, "No SSE? Run on a more modern machine!");
    assert!(has_osfxsr, "No fxsave? Run on a more modern machine!");
    assert!(has_sse3, "No SSE3? Run on a more modern machine!"); //TBD
    //assert!(has_avx, "No AVX? Run on a more modern machine!");
    assert!(has_apic, "No APIC? Run on a more modern machine!");
    assert!(has_x2apic, "No X2APIC? Run on a more modern machine!");
    assert!(has_syscalls, "No sysenter? Run on a more modern machine!");
    assert!(has_pae, "No PAE? Run on a more modern machine!");
    assert!(has_msr, "No MSR? Run on a more modern machine!");
}
fn assert_required_cpu_features ( ) { let cpuid = cpuid :: CpuId :: new ( ) ; let fi = cpuid . get_feature_info ( ) ; let has_apic = fi . as_ref ( ) . map_or ( false , | f | f . has_apic ( ) ) ; let has_x2apic = fi . as_ref ( ) . map_or ( false , | f | f . has_x2apic ( ) ) ; let has_tsc = fi . as_ref ( ) . map_or ( false , | f | f . has_tsc ( ) ) ; let has_syscalls = fi . as_ref ( ) . map_or ( false , | f | f . has_sysenter_sysexit ( ) ) ; let has_pae = fi . as_ref ( ) . map_or ( false , | f | f . has_pae ( ) ) ; let has_msr = fi . as_ref ( ) . map_or ( false , | f | f . has_msr ( ) ) ; let has_sse = fi . as_ref ( ) . map_or ( false , | f | f . has_sse ( ) ) ; let has_sse3 = fi . as_ref ( ) . map_or ( false , | f | f . has_sse3 ( ) ) ; let _has_avx = fi . as_ref ( ) . map_or ( false , | f | f . has_avx ( ) ) ; let has_osfxsr = fi . as_ref ( ) . map_or ( false , | f | f . has_fxsave_fxstor ( ) ) ; assert ! ( has_tsc " " ) ; assert ! ( has_sse " " ) ; assert ! ( has_osfxsr " " ) ; assert ! ( has_sse3 " " ) ; //TBD //assert!(has_avx, "No AVX? Run on a more modern machine!"); assert ! ( has_apic " " ) ; assert ! ( has_x2apic " " ) ; assert ! ( has_syscalls " " ) ; assert ! ( has_pae " " ) ; assert ! ( has_msr " " ) ; }
Make sure the machine supports what we require.
Make sure the machine supports what we require .