Skip to content

chore: bump MSRV to 1.84 #7926

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 6 commits into from
Jul 15, 2025
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
14 changes: 1 addition & 13 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ on:
pull_request:

jobs:

# Check workspace wide compile and test with default features for
# mac
macos:
Expand All @@ -54,7 +53,6 @@ jobs:
# PyArrow tests happen in integration.yml.
cargo test --workspace


# Check workspace wide compile and test with default features for
# windows
windows:
Expand Down Expand Up @@ -84,8 +82,7 @@ jobs:
# do not produce debug symbols to keep memory usage down
export RUSTFLAGS="-C debuginfo=0"
export PATH=$PATH:/d/protoc/bin
cargo test --workspace

cargo test --workspace

# Run cargo fmt for all crates
lint:
Expand Down Expand Up @@ -121,15 +118,6 @@ jobs:
uses: ./.github/actions/setup-builder
- name: Install cargo-msrv
run: cargo install cargo-msrv
- name: Downgrade arrow-pyarrow-integration-testing dependencies
working-directory: arrow-pyarrow-integration-testing
# Necessary because half 2.5 requires rust 1.81 or newer
run: |
cargo update -p half --precise 2.4.0
- name: Downgrade workspace dependencies
# Necessary because half 2.5 requires rust 1.81 or newer
run: |
cargo update -p half --precise 2.4.0
- name: Check all packages
run: |
# run `cargo msrv verify --manifest-path "path/to/Cargo.toml"` to see problematic dependencies
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ include = [
"NOTICE.txt",
]
edition = "2021"
rust-version = "1.81"
rust-version = "1.84"

[workspace.dependencies]
arrow = { version = "55.2.0", path = "./arrow", default-features = false }
Expand All @@ -102,7 +102,7 @@ arrow-string = { version = "55.2.0", path = "./arrow-string" }
parquet = { version = "55.2.0", path = "./parquet", default-features = false }

# These crates have not yet been released and thus do not use the workspace version
parquet-variant = { version = "0.1.0", path = "./parquet-variant"}
parquet-variant = { version = "0.1.0", path = "./parquet-variant" }
parquet-variant-json = { version = "0.1.0", path = "./parquet-variant-json" }
parquet-variant-compute = { version = "0.1.0", path = "./parquet-variant-json" }

Expand Down
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,10 @@ Planned Release Schedule

### Rust Version Compatibility Policy

arrow-rs, parquet and object_store are built and tested with stable Rust, and will keep a rolling MSRV (minimum supported Rust version) that can only be updated in major releases on a need by basis (e.g. project dependencies bump their MSRV or a particular Rust feature is useful for us etc.). The new MSRV if selected will be at least 6 months old. The minor releases are guaranteed to have the same MSRV.
arrow-rs and parquet are built and tested with stable Rust, and will keep a rolling MSRV (minimum supported Rust version) that can only be updated in major releases on a need by basis (e.g. project dependencies bump their MSRV or a particular Rust feature is useful for us etc.). The new MSRV if selected will be at least 6 months old. The minor releases are guaranteed to have the same MSRV.

Note: If a Rust hotfix is released for the current MSRV, the MSRV will be updated to the specific minor version that includes all applicable hotfixes preceding other policies.

E.g.

in Apr 2025 we will release version 55.0.0 which might have a version bump. But the Rust version selected in this case will be at most version 1.81.

### Guidelines for `panic` vs `Result`

In general, use panics for bad states that are unreachable, unrecoverable or harmful.
Expand Down
11 changes: 3 additions & 8 deletions arrow-array/benches/union_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@
// specific language governing permissions and limitations
// under the License.

use std::{
hint,
iter::{repeat, repeat_with},
sync::Arc,
};
use std::{hint, iter::repeat_with, sync::Arc};

use arrow_array::{Array, ArrayRef, Int32Array, UnionArray};
use arrow_buffer::{NullBuffer, ScalarBuffer};
Expand Down Expand Up @@ -67,9 +63,8 @@ fn criterion_benchmark(c: &mut Criterion) {
fields,
type_ids.cycle().take(4096).collect(),
None,
repeat(array_with_nulls())
.take(with_nulls as usize)
.chain(repeat(array_without_nulls()).take(without_nulls as usize))
std::iter::repeat_n(array_with_nulls(), with_nulls as usize)
.chain(std::iter::repeat_n(array_without_nulls(), without_nulls as usize))
.collect(),
)
.unwrap();
Expand Down
8 changes: 4 additions & 4 deletions arrow-array/src/arithmetic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -420,13 +420,13 @@ native_type_float_op!(
1.,
unsafe {
// Need to allow in clippy because
// current MSRV (Minimum Supported Rust Version) is `1.81.0` but this item is stable since `1.87.0`
// current MSRV (Minimum Supported Rust Version) is `1.84.0` but this item is stable since `1.87.0`
#[allow(unnecessary_transmutes)]
std::mem::transmute(-1_i32)
},
unsafe {
// Need to allow in clippy because
// current MSRV (Minimum Supported Rust Version) is `1.81.0` but this item is stable since `1.87.0`
// current MSRV (Minimum Supported Rust Version) is `1.84.0` but this item is stable since `1.87.0`
#[allow(unnecessary_transmutes)]
std::mem::transmute(i32::MAX)
}
Expand All @@ -437,13 +437,13 @@ native_type_float_op!(
1.,
unsafe {
// Need to allow in clippy because
// current MSRV (Minimum Supported Rust Version) is `1.81.0` but this item is stable since `1.87.0`
// current MSRV (Minimum Supported Rust Version) is `1.84.0` but this item is stable since `1.87.0`
#[allow(unnecessary_transmutes)]
std::mem::transmute(-1_i64)
},
unsafe {
// Need to allow in clippy because
// current MSRV (Minimum Supported Rust Version) is `1.81.0` but this item is stable since `1.87.0`
// current MSRV (Minimum Supported Rust Version) is `1.84.0` but this item is stable since `1.87.0`
#[allow(unnecessary_transmutes)]
std::mem::transmute(i64::MAX)
}
Expand Down
2 changes: 1 addition & 1 deletion arrow-array/src/array/list_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ impl<OffsetSize: OffsetSizeTrait> From<FixedSizeListArray> for GenericListArray<
_ => unreachable!(),
};

let offsets = OffsetBuffer::from_lengths(std::iter::repeat(size).take(value.len()));
let offsets = OffsetBuffer::from_lengths(std::iter::repeat_n(size, value.len()));

Self {
data_type: Self::DATA_TYPE_CONSTRUCTOR(field.clone()),
Expand Down
2 changes: 1 addition & 1 deletion arrow-array/src/array/list_view_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ impl<OffsetSize: OffsetSizeTrait> From<FixedSizeListArray> for GenericListViewAr
_ => unreachable!(),
};
let mut acc = 0_usize;
let iter = std::iter::repeat(size).take(value.len());
let iter = std::iter::repeat_n(size, value.len());
let mut sizes = Vec::with_capacity(iter.size_hint().0);
let mut offsets = Vec::with_capacity(iter.size_hint().0);

Expand Down
2 changes: 1 addition & 1 deletion arrow-avro/src/reader/record.rs
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ impl Decoder {
moff.push_length(0);
}
Self::Fixed(sz, accum) => {
accum.extend(std::iter::repeat(0u8).take(*sz as usize));
accum.extend(std::iter::repeat_n(0u8, *sz as usize));
}
Self::Decimal128(_, _, _, builder) => builder.append_value(0),
Self::Decimal256(_, _, _, builder) => builder.append_value(i256::ZERO),
Expand Down
6 changes: 3 additions & 3 deletions arrow-buffer/src/buffer/immutable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -997,13 +997,13 @@ mod tests {
#[should_panic(expected = "capacity overflow")]
fn test_from_iter_overflow() {
let iter_len = usize::MAX / std::mem::size_of::<u64>() + 1;
let _ = Buffer::from_iter(std::iter::repeat(0_u64).take(iter_len));
let _ = Buffer::from_iter(std::iter::repeat_n(0_u64, iter_len));
}

#[test]
fn bit_slice_length_preserved() {
// Create a boring buffer
let buf = Buffer::from_iter(std::iter::repeat(true).take(64));
let buf = Buffer::from_iter(std::iter::repeat_n(true, 64));

let assert_preserved = |offset: usize, len: usize| {
let new_buf = buf.bit_slice(offset, len);
Expand Down Expand Up @@ -1035,7 +1035,7 @@ mod tests {

#[test]
fn test_strong_count() {
let buffer = Buffer::from_iter(std::iter::repeat(0_u8).take(100));
let buffer = Buffer::from_iter(std::iter::repeat_n(0_u8, 100));
assert_eq!(buffer.strong_count(), 1);

let buffer2 = buffer.clone();
Expand Down
4 changes: 2 additions & 2 deletions arrow-buffer/src/builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub use null::*;
pub use offset::*;

use crate::{ArrowNativeType, Buffer, MutableBuffer};
use std::{iter, marker::PhantomData};
use std::marker::PhantomData;

/// Builder for creating a [Buffer] object.
///
Expand Down Expand Up @@ -214,7 +214,7 @@ impl<T: ArrowNativeType> BufferBuilder<T> {
#[inline]
pub fn append_n(&mut self, n: usize, v: T) {
self.reserve(n);
self.extend(iter::repeat(v).take(n))
self.extend(std::iter::repeat_n(v, n))
}

/// Appends `n`, zero-initialized values
Expand Down
2 changes: 1 addition & 1 deletion arrow-cast/src/cast/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub(crate) fn cast_values_to_list<O: OffsetSizeTrait>(
cast_options: &CastOptions,
) -> Result<ArrayRef, ArrowError> {
let values = cast_with_options(array, to.data_type(), cast_options)?;
let offsets = OffsetBuffer::from_lengths(std::iter::repeat(1).take(values.len()));
let offsets = OffsetBuffer::from_lengths(std::iter::repeat_n(1, values.len()));
let list = GenericListArray::<O>::new(to.clone(), offsets, values, None);
Ok(Arc::new(list))
}
Expand Down
2 changes: 1 addition & 1 deletion arrow-cast/src/cast/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2167,7 +2167,7 @@ fn cast_numeric_to_binary<FROM: ArrowPrimitiveType, O: OffsetSizeTrait>(
) -> Result<ArrayRef, ArrowError> {
let array = array.as_primitive::<FROM>();
let size = std::mem::size_of::<FROM::Native>();
let offsets = OffsetBuffer::from_lengths(std::iter::repeat(size).take(array.len()));
let offsets = OffsetBuffer::from_lengths(std::iter::repeat_n(size, array.len()));
Ok(Arc::new(GenericBinaryArray::<O>::new(
offsets,
array.values().inner().clone(),
Expand Down
2 changes: 1 addition & 1 deletion arrow-data/src/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ impl ArrayData {
),
DataType::Union(f, mode) => {
let (id, _) = f.iter().next().unwrap();
let ids = Buffer::from_iter(std::iter::repeat(id).take(len));
let ids = Buffer::from_iter(std::iter::repeat_n(id, len));
let buffers = match mode {
UnionMode::Sparse => vec![ids],
UnionMode::Dense => {
Expand Down
4 changes: 2 additions & 2 deletions arrow-flight/src/encode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1695,9 +1695,9 @@ mod tests {

#[tokio::test]
async fn flight_data_size_even() {
let s1 = StringArray::from_iter_values(std::iter::repeat(".10 bytes.").take(1024));
let s1 = StringArray::from_iter_values(std::iter::repeat_n(".10 bytes.", 1024));
let i1 = Int16Array::from_iter_values(0..1024);
let s2 = StringArray::from_iter_values(std::iter::repeat("6bytes").take(1024));
let s2 = StringArray::from_iter_values(std::iter::repeat_n("6bytes", 1024));
let i2 = Int64Array::from_iter_values(0..1024);

let batch = RecordBatch::try_from_iter(vec![
Expand Down
2 changes: 1 addition & 1 deletion arrow-ord/src/sort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1791,7 +1791,7 @@ mod tests {
None => {
builder
.values()
.extend(std::iter::repeat(None).take(fixed_length as usize));
.extend(std::iter::repeat_n(None, fixed_length as usize));
builder.append(false);
}
}
Expand Down
2 changes: 1 addition & 1 deletion arrow-pyarrow-integration-testing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ authors = ["Apache Arrow <dev@arrow.apache.org>"]
license = "Apache-2.0"
keywords = ["arrow"]
edition = "2021"
rust-version = "1.81"
rust-version = "1.84"
publish = false

[lib]
Expand Down
4 changes: 2 additions & 2 deletions arrow-pyarrow-testing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ homepage = "https://github.com/apache/arrow-rs"
repository = "https://github.com/apache/arrow-rs"
authors = ["Apache Arrow <dev@arrow.apache.org>"]
license = "Apache-2.0"
keywords = [ "arrow" ]
keywords = ["arrow"]
edition = "2021"
rust-version = "1.81"
rust-version = "1.84"
publish = false


Expand Down
2 changes: 1 addition & 1 deletion arrow-select/src/coalesce.rs
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ mod tests {
// The strings are designed to exactly fit into buffers that are powers of 2 long
let batch = stringview_batch_repeated(100, [Some("This string is a power of two=32")]);
let output_batches = Test::new()
.with_batches(std::iter::repeat(batch).take(20))
.with_batches(std::iter::repeat_n(batch, 20))
.with_batch_size(900)
.with_expected_output_sizes(vec![900, 900, 200])
.run();
Expand Down
6 changes: 3 additions & 3 deletions arrow-select/src/concat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1335,7 +1335,7 @@ mod tests {
assert_eq!(data.buffers()[0].len(), 120);
assert_eq!(data.buffers()[0].capacity(), 128); // Nearest multiple of 64

let a = StringArray::from_iter_values(std::iter::repeat("foo").take(100));
let a = StringArray::from_iter_values(std::iter::repeat_n("foo", 100));
let b = StringArray::from(vec!["bingo", "bongo", "lorem", ""]);

let a = concat(&[&a, &b]).unwrap();
Expand All @@ -1358,8 +1358,8 @@ mod tests {
assert_eq!(data.buffers()[1].len(), 135);
assert_eq!(data.buffers()[1].capacity(), 192); // Nearest multiple of 64

let a = LargeBinaryArray::from_iter_values(std::iter::repeat(b"foo").take(100));
let b = LargeBinaryArray::from_iter_values(std::iter::repeat(b"cupcakes").take(10));
let a = LargeBinaryArray::from_iter_values(std::iter::repeat_n(b"foo", 100));
let b = LargeBinaryArray::from_iter_values(std::iter::repeat_n(b"cupcakes", 10));

let a = concat(&[&a, &b]).unwrap();
let data = a.to_data();
Expand Down
11 changes: 5 additions & 6 deletions arrow-select/src/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1449,12 +1449,11 @@ mod tests {
#[test]
fn test_slices() {
// takes up 2 u64s
let bools = std::iter::repeat(true)
.take(10)
.chain(std::iter::repeat(false).take(30))
.chain(std::iter::repeat(true).take(20))
.chain(std::iter::repeat(false).take(17))
.chain(std::iter::repeat(true).take(4));
let bools = std::iter::repeat_n(true, 10)
.chain(std::iter::repeat_n(false, 30))
.chain(std::iter::repeat_n(true, 20))
.chain(std::iter::repeat_n(false, 17))
.chain(std::iter::repeat_n(true, 4));

let bool_array: BooleanArray = bools.map(Some).collect();

Expand Down
2 changes: 1 addition & 1 deletion arrow/benches/array_data_validate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ fn validate_benchmark(c: &mut Criterion) {
b.iter(|| validate_utf8_array(&str_arr))
});

let byte_array = BinaryArray::from_iter_values(std::iter::repeat(b"test").take(20000));
let byte_array = BinaryArray::from_iter_values(std::iter::repeat_n(b"test", 20000));
c.bench_function("byte_array_to_string_array 20000", |b| {
b.iter(|| StringArray::from(BinaryArray::from(byte_array.to_data())))
});
Expand Down
11 changes: 5 additions & 6 deletions arrow/benches/partition_kernels.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use arrow::{
};
use arrow_ord::partition::partition;
use rand::distr::{Distribution, StandardUniform};
use std::{hint, iter};
use std::hint;

fn create_array<T: ArrowPrimitiveType>(size: usize, with_nulls: bool) -> ArrayRef
where
Expand All @@ -45,11 +45,10 @@ fn bench_partition(sorted_columns: &[ArrayRef]) {

fn create_sorted_low_cardinality_data(length: usize) -> Vec<ArrayRef> {
let arr = Int64Array::from_iter_values(
iter::repeat(1)
.take(length / 4)
.chain(iter::repeat(2).take(length / 4))
.chain(iter::repeat(3).take(length / 4))
.chain(iter::repeat(4).take(length / 4)),
std::iter::repeat_n(1, length / 4)
.chain(std::iter::repeat_n(2, length / 4))
.chain(std::iter::repeat_n(3, length / 4))
.chain(std::iter::repeat_n(4, length / 4)),
);
lexsort(
&[SortColumn {
Expand Down
2 changes: 1 addition & 1 deletion arrow/benches/string_run_iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ fn build_strings_runs(
let run_len = logical_array_len / physical_array_len;
let mut values: Vec<String> = (0..physical_array_len)
.map(|_| (0..string_len).map(|_| rng.random::<char>()).collect())
.flat_map(|s| std::iter::repeat(s).take(run_len))
.flat_map(|s| std::iter::repeat_n(s, run_len))
.collect();
while values.len() < logical_array_len {
let last_val = values[values.len() - 1].clone();
Expand Down
4 changes: 2 additions & 2 deletions arrow/src/util/bench_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ pub fn create_primitive_run_array<R: RunEndIndexType, V: ArrowPrimitiveType>(
take_len += 1;
run_len_extra -= 1;
}
std::iter::repeat(V::Native::from_usize(s).unwrap()).take(take_len)
std::iter::repeat_n(V::Native::from_usize(s).unwrap(), take_len)
})
.collect();
while values.len() < logical_array_len {
Expand Down Expand Up @@ -434,7 +434,7 @@ pub fn create_string_array_for_runs(
take_len += 1;
run_len_extra -= 1;
}
std::iter::repeat(s).take(take_len)
std::iter::repeat_n(s, take_len)
})
.collect();
while values.len() < logical_array_len {
Expand Down
3 changes: 1 addition & 2 deletions parquet-variant-compute/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ repository = { workspace = true }
authors = { workspace = true }
keywords = ["arrow", "parquet", "variant"]
edition = { workspace = true }
# parquet-variant needs newer version than workspace
Copy link
Contributor

Choose a reason for hiding this comment

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

🎉

rust-version = "1.83"
rust-version = { workspace = true }


[dependencies]
Expand Down
3 changes: 1 addition & 2 deletions parquet-variant-json/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ authors = { workspace = true }
keywords = ["arrow", "parquet", "variant"]
readme = "README.md"
edition = { workspace = true }
# parquet-variant needs newer version than workspace
rust-version = "1.83"
rust-version = { workspace = true }


[dependencies]
Expand Down
Loading
Loading