From fccc7a515c0e134b3b96d03e7aa25c7f25b5ccc8 Mon Sep 17 00:00:00 2001 From: Kamil Skalski Date: Fri, 6 Feb 2026 18:09:52 +0800 Subject: [PATCH 1/2] Bump rust to 1.94 and nightly to 2026-01-18 --- ci/rust-version.sh | 2 +- rust-toolchain.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/rust-version.sh b/ci/rust-version.sh index e174a079d53406..0f976bb20acf04 100644 --- a/ci/rust-version.sh +++ b/ci/rust-version.sh @@ -29,7 +29,7 @@ fi if [[ -n ${RUST_NIGHTLY_VERSION:-} ]]; then nightly_version="$RUST_NIGHTLY_VERSION" else - nightly_version=2025-12-05 + nightly_version=2026-01-18 fi diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 535513300d5b7f..76a06e6b881a26 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "1.93.1" +channel = "1.94.0" From e9a043b308438cf057411a3e62d1fbac21159973 Mon Sep 17 00:00:00 2001 From: Kamil Skalski Date: Wed, 11 Mar 2026 12:28:26 +0800 Subject: [PATCH 2/2] clippy(core): remove unsafe wrapping block in report_cpuid_values --- core/src/system_monitor_service.rs | 154 ++++++++++++++--------------- 1 file changed, 76 insertions(+), 78 deletions(-) diff --git a/core/src/system_monitor_service.rs b/core/src/system_monitor_service.rs index 5538f62bf7b99e..a7f46a57c21536 100644 --- a/core/src/system_monitor_service.rs +++ b/core/src/system_monitor_service.rs @@ -726,88 +726,86 @@ impl SystemMonitorService { const CPUID_MANUFACTURER_EDX_AMD: u32 = 0x69746e65; const CPUID_MANUFACTURER_ECX_AMD: u32 = 0x444d4163; - unsafe { - let cpuid_mfr = __cpuid(0); - let cpuid_empty = CpuidResult { - eax: 0, - ebx: 0, - ecx: 0, - edx: 0, - }; - - let max_leaf = match CpuidParamValue::try_from(std::cmp::min( - cpuid_mfr.eax, - CPUID_PARAM_MAX_SUPPORTED_VALUE, - )) { - Ok(val) => val, - Err(_err) => CpuidParamValue::Manufacturer, - }; - - let mfr_id = if cpuid_mfr.ebx == CPUID_MANUFACTURER_EBX_INTEL - && cpuid_mfr.edx == CPUID_MANUFACTURER_EDX_INTEL - && cpuid_mfr.ecx == CPUID_MANUFACTURER_ECX_INTEL - { - CpuManufacturer::Intel // GenuineIntel - } else if cpuid_mfr.ebx == CPUID_MANUFACTURER_EBX_AMD - && cpuid_mfr.edx == CPUID_MANUFACTURER_EDX_AMD - && cpuid_mfr.ecx == CPUID_MANUFACTURER_ECX_AMD - { - CpuManufacturer::Amd // AuthenticAMD - } else { - CpuManufacturer::Other // anything else - }; + let cpuid_mfr = __cpuid(0); + let cpuid_empty = CpuidResult { + eax: 0, + ebx: 0, + ecx: 0, + edx: 0, + }; - let cpuid_processor = if CpuidParamValue::Processor <= max_leaf { - __cpuid(CpuidParamValue::Processor.into()) - } else { - cpuid_empty - }; - let cpuid_cache = if CpuidParamValue::Cache <= max_leaf { - __cpuid(CpuidParamValue::Cache.into()) - } else { - cpuid_empty - }; - let cpuid_topology = if CpuidParamValue::Topology <= max_leaf { - __cpuid(CpuidParamValue::Topology.into()) - } else { - cpuid_empty - }; - let cpuid_extended_0 = if CpuidParamValue::Extended <= max_leaf { - __cpuid_count(CpuidParamValue::Extended.into(), 0) - } else { - cpuid_empty - }; - let cpuid_extended_1 = if CpuidParamValue::Extended <= max_leaf { - if 1 <= __get_cpuid_max(CpuidParamValue::Extended.into()).1 { - __cpuid_count(CpuidParamValue::Extended.into(), 1) - } else { - cpuid_empty - } + let max_leaf = match CpuidParamValue::try_from(std::cmp::min( + cpuid_mfr.eax, + CPUID_PARAM_MAX_SUPPORTED_VALUE, + )) { + Ok(val) => val, + Err(_err) => CpuidParamValue::Manufacturer, + }; + + let mfr_id = if cpuid_mfr.ebx == CPUID_MANUFACTURER_EBX_INTEL + && cpuid_mfr.edx == CPUID_MANUFACTURER_EDX_INTEL + && cpuid_mfr.ecx == CPUID_MANUFACTURER_ECX_INTEL + { + CpuManufacturer::Intel // GenuineIntel + } else if cpuid_mfr.ebx == CPUID_MANUFACTURER_EBX_AMD + && cpuid_mfr.edx == CPUID_MANUFACTURER_EDX_AMD + && cpuid_mfr.ecx == CPUID_MANUFACTURER_ECX_AMD + { + CpuManufacturer::Amd // AuthenticAMD + } else { + CpuManufacturer::Other // anything else + }; + + let cpuid_processor = if CpuidParamValue::Processor <= max_leaf { + __cpuid(CpuidParamValue::Processor.into()) + } else { + cpuid_empty + }; + let cpuid_cache = if CpuidParamValue::Cache <= max_leaf { + __cpuid(CpuidParamValue::Cache.into()) + } else { + cpuid_empty + }; + let cpuid_topology = if CpuidParamValue::Topology <= max_leaf { + __cpuid(CpuidParamValue::Topology.into()) + } else { + cpuid_empty + }; + let cpuid_extended_0 = if CpuidParamValue::Extended <= max_leaf { + __cpuid_count(CpuidParamValue::Extended.into(), 0) + } else { + cpuid_empty + }; + let cpuid_extended_1 = if CpuidParamValue::Extended <= max_leaf { + if 1 <= __get_cpuid_max(CpuidParamValue::Extended.into()).1 { + __cpuid_count(CpuidParamValue::Extended.into(), 1) } else { cpuid_empty - }; - - datapoint_info!( - "cpuid-values", - ("manufacturer_id", i64::from(mfr_id), i64), - ("cpuid_processor_eax", i64::from(cpuid_processor.eax), i64), - ("cpuid_processor_ebx", i64::from(cpuid_processor.ebx), i64), - ("cpuid_processor_ecx", i64::from(cpuid_processor.ecx), i64), - ("cpuid_processor_edx", i64::from(cpuid_processor.edx), i64), - ("cpuid_cache_eax", i64::from(cpuid_cache.eax), i64), - ("cpuid_cache_ebx", i64::from(cpuid_cache.ebx), i64), - ("cpuid_cache_ecx", i64::from(cpuid_cache.ecx), i64), - ("cpuid_cache_edx", i64::from(cpuid_cache.edx), i64), - ("cpuid_topology_eax", i64::from(cpuid_topology.eax), i64), - ("cpuid_topology_ebx", i64::from(cpuid_topology.ebx), i64), - ("cpuid_topology_ecx", i64::from(cpuid_topology.ecx), i64), - ("cpuid_topology_edx", i64::from(cpuid_topology.edx), i64), - ("cpuid_extended_0_ebx", i64::from(cpuid_extended_0.ebx), i64), - ("cpuid_extended_0_ecx", i64::from(cpuid_extended_0.ecx), i64), - ("cpuid_extended_0_edx", i64::from(cpuid_extended_0.edx), i64), - ("cpuid_extended_1_eax", i64::from(cpuid_extended_1.eax), i64), - ); + } + } else { + cpuid_empty }; + + datapoint_info!( + "cpuid-values", + ("manufacturer_id", i64::from(mfr_id), i64), + ("cpuid_processor_eax", i64::from(cpuid_processor.eax), i64), + ("cpuid_processor_ebx", i64::from(cpuid_processor.ebx), i64), + ("cpuid_processor_ecx", i64::from(cpuid_processor.ecx), i64), + ("cpuid_processor_edx", i64::from(cpuid_processor.edx), i64), + ("cpuid_cache_eax", i64::from(cpuid_cache.eax), i64), + ("cpuid_cache_ebx", i64::from(cpuid_cache.ebx), i64), + ("cpuid_cache_ecx", i64::from(cpuid_cache.ecx), i64), + ("cpuid_cache_edx", i64::from(cpuid_cache.edx), i64), + ("cpuid_topology_eax", i64::from(cpuid_topology.eax), i64), + ("cpuid_topology_ebx", i64::from(cpuid_topology.ebx), i64), + ("cpuid_topology_ecx", i64::from(cpuid_topology.ecx), i64), + ("cpuid_topology_edx", i64::from(cpuid_topology.edx), i64), + ("cpuid_extended_0_ebx", i64::from(cpuid_extended_0.ebx), i64), + ("cpuid_extended_0_ecx", i64::from(cpuid_extended_0.ecx), i64), + ("cpuid_extended_0_edx", i64::from(cpuid_extended_0.edx), i64), + ("cpuid_extended_1_eax", i64::from(cpuid_extended_1.eax), i64), + ); } fn report_cpu_stats() {