Skip to content

Commit 8a9d46c

Browse files
committed
fix: build with Rust 1.99, which deprecates the legacy f64 constants and fetch_update
Rust 1.99.0, released 2026-10-01, deprecates the legacy numeric module constants and `Atomic*::fetch_update`. CI installs the latest stable toolchain, so `cargo clippy -- -D warnings` in the rust-test job has failed on every pull request and merge queue run since. - A test module in `numeric.rs` imported `core::f64`, so its `f64::NAN`, `f64::INFINITY` and the other constants named the deprecated module constants. Without the import they are the associated constants on `f64`. - The four `fetch_update` calls in the memory pools keep it under `#[allow(deprecated)]`. Its replacement, `try_update`, was stabilized in Rust 1.95, newer than the workspace `rust-version` of 1.94.
1 parent d5de7b9 commit 8a9d46c

3 files changed

Lines changed: 12 additions & 1 deletion

File tree

‎native/core/src/execution/memory_pools/spark_memory.rs‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,9 @@ impl SparkMemory {
174174
}
175175

176176
/// Takes up to `size` bytes off the overcommit in one atomic step and returns how many.
177+
// Rust 1.99 deprecates `fetch_update` in favor of `try_update`, which needs Rust 1.95, newer
178+
// than the workspace `rust-version`.
179+
#[allow(deprecated)]
177180
fn repay(&self, size: usize) -> usize {
178181
let debt = self
179182
.overcommit

‎native/core/src/execution/memory_pools/unified_pool.rs‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ impl MemoryPool for CometUnifiedMemoryPool {
8787
}
8888

8989
/// Records memory that already exists, so it must not fail; see [`SparkMemory`].
90+
// Rust 1.99 deprecates `fetch_update` in favor of `try_update`, which needs Rust 1.95, newer
91+
// than the workspace `rust-version`.
92+
#[allow(deprecated)]
9093
fn grow(&self, _: &MemoryReservation, additional: usize) {
9194
if additional == 0 {
9295
return;
@@ -97,6 +100,9 @@ impl MemoryPool for CometUnifiedMemoryPool {
97100
.unwrap();
98101
}
99102

103+
// Rust 1.99 deprecates `fetch_update` in favor of `try_update`, which needs Rust 1.95, newer
104+
// than the workspace `rust-version`.
105+
#[allow(deprecated)]
100106
fn shrink(&self, _: &MemoryReservation, size: usize) {
101107
if let Err(e) = self.spark.release(size) {
102108
panic!(
@@ -115,6 +121,9 @@ impl MemoryPool for CometUnifiedMemoryPool {
115121
}
116122
}
117123

124+
// Rust 1.99 deprecates `fetch_update` in favor of `try_update`, which needs Rust 1.95, newer
125+
// than the workspace `rust-version`.
126+
#[allow(deprecated)]
118127
fn try_grow(&self, _: &MemoryReservation, additional: usize) -> Result<(), DataFusionError> {
119128
if additional > 0 {
120129
// A partial grant is handed back and refused, which triggers spilling in the caller.

‎native/spark-expr/src/conversion_funcs/numeric.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1432,7 +1432,6 @@ mod tests {
14321432
use super::*;
14331433
use arrow::array::AsArray;
14341434
use arrow::datatypes::TimestampMicrosecondType;
1435-
use core::f64;
14361435

14371436
#[test]
14381437
fn test_spark_cast_int_to_int_overflow() {

0 commit comments

Comments
 (0)