Skip to content

Update minimum rust version to 1.72 #8997

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,11 @@ jobs:
./dev/update_config_docs.sh
git diff --exit-code

# Verify MSRV for the crates which are directly used by other projects.
# Verify MSRV for the crates which are directly used by other projects:
# - datafusion
# - datafusion-substrait
# - datafusion-proto
# - datafusion-cli
msrv:
name: Verify MSRV (Min Supported Rust Version)
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ homepage = "https://github.com/apache/arrow-datafusion"
license = "Apache-2.0"
readme = "README.md"
repository = "https://github.com/apache/arrow-datafusion"
rust-version = "1.70"
rust-version = "1.72"
version = "35.0.0"

[workspace.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ authors = ["Apache Arrow <dev@arrow.apache.org>"]
homepage = "https://github.com/apache/arrow-datafusion"
repository = "https://github.com/apache/arrow-datafusion"
license = "Apache-2.0"
rust-version = "1.70"
rust-version = { workspace = true }

[features]
ci = []
Expand Down
3 changes: 2 additions & 1 deletion datafusion-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ keywords = ["arrow", "datafusion", "query", "sql"]
license = "Apache-2.0"
homepage = "https://github.com/apache/arrow-datafusion"
repository = "https://github.com/apache/arrow-datafusion"
rust-version = "1.70"
# Specify MSRV here as `cargo msrv` doesn't support workspace version
rust-version = "1.72"
readme = "README.md"

[dependencies]
Expand Down
5 changes: 4 additions & 1 deletion datafusion/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ homepage = { workspace = true }
repository = { workspace = true }
license = { workspace = true }
authors = { workspace = true }
rust-version = "1.70"
# Specify MSRV here as `cargo msrv` doesn't support workspace version and fails with
# "Unable to find key 'package.rust-version' (or 'package.metadata.msrv') in 'arrow-datafusion/Cargo.toml'"
# https://github.com/foresterre/cargo-msrv/issues/590
rust-version = "1.72"

[lib]
name = "datafusion"
Expand Down
11 changes: 3 additions & 8 deletions datafusion/expr/src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ use datafusion_common::{plan_err, Column, DataFusionError, Result, ScalarValue};
use std::collections::HashSet;
use std::fmt;
use std::fmt::{Display, Formatter, Write};
use std::hash::{BuildHasher, Hash, Hasher};
use std::hash::Hash;
use std::str::FromStr;
use std::sync::Arc;

Expand Down Expand Up @@ -853,13 +853,8 @@ const SEED: ahash::RandomState = ahash::RandomState::with_seeds(0, 0, 0, 0);

impl PartialOrd for Expr {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
let mut hasher = SEED.build_hasher();
self.hash(&mut hasher);
let s = hasher.finish();

let mut hasher = SEED.build_hasher();
other.hash(&mut hasher);
let o = hasher.finish();
let s = SEED.hash_one(self);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clippy failed on this for me with the updated MSRV so I did what it told me

let o = SEED.hash_one(other);

Some(s.cmp(&o))
}
Expand Down
8 changes: 3 additions & 5 deletions datafusion/physical-expr/src/aggregate/hyperloglog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
//!
//! This module also borrows some code structure from [pdatastructs.rs](https://github.com/crepererum/pdatastructs.rs/blob/3997ed50f6b6871c9e53c4c5e0f48f431405fc63/src/hyperloglog.rs).

use ahash::{AHasher, RandomState};
use std::hash::{BuildHasher, Hash, Hasher};
use ahash::RandomState;
use std::hash::Hash;
use std::marker::PhantomData;

/// The greater is P, the smaller the error.
Expand Down Expand Up @@ -102,9 +102,7 @@ where
/// reasonable performance.
#[inline]
fn hash_value(&self, obj: &T) -> u64 {
let mut hasher: AHasher = SEED.build_hasher();
obj.hash(&mut hasher);
hasher.finish()
SEED.hash_one(obj)
}

/// Adds an element to the HyperLogLog.
Expand Down
3 changes: 2 additions & 1 deletion datafusion/proto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ homepage = { workspace = true }
repository = { workspace = true }
license = { workspace = true }
authors = { workspace = true }
rust-version = "1.70"
# Specify MSRV here as `cargo msrv` doesn't support workspace version
rust-version = "1.72"

# Exclude proto files so crates.io consumers don't need protoc
exclude = ["*.proto"]
Expand Down
2 changes: 1 addition & 1 deletion datafusion/proto/gen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ name = "gen"
description = "Code generation for proto"
version = "0.1.0"
edition = { workspace = true }
rust-version = "1.64"
rust-version = "1.72"
authors = ["Apache Arrow <dev@arrow.apache.org>"]
homepage = "https://github.com/apache/arrow-datafusion"
repository = "https://github.com/apache/arrow-datafusion"
Expand Down
3 changes: 2 additions & 1 deletion datafusion/substrait/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ homepage = { workspace = true }
repository = { workspace = true }
license = { workspace = true }
authors = { workspace = true }
rust-version = "1.70"
# Specify MSRV here as `cargo msrv` doesn't support workspace version
rust-version = "1.72"

[dependencies]
async-recursion = "1.0"
Expand Down
2 changes: 1 addition & 1 deletion datafusion/wasmtest/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ homepage = { workspace = true }
repository = { workspace = true }
license = { workspace = true }
authors = { workspace = true }
rust-version = "1.70"
rust-version = { workspace = true }

[lib]
crate-type = ["cdylib", "rlib"]
Expand Down
2 changes: 1 addition & 1 deletion docs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ homepage = { workspace = true }
repository = { workspace = true }
license = { workspace = true }
authors = { workspace = true }
rust-version = "1.70"
rust-version = { workspace = true }

[dependencies]
datafusion = { path = "../datafusion/core", version = "35.0.0", default-features = false }