Skip to content

Commit 9c0cb9a

Browse files
authored
chore: bump MSRV to 1.84 (#7926)
# Which issue does this PR close? None. # Rationale for this change - This allows us to keep up with dependencies bumping their MSRV (e.g. #7924) - parquet variant crates now use the workspace MSRV - #7395 is the next release and because this is a major release we can bump MSRV now for all the 56.x.y releases We can bump to 1.85 in #7835 to unblock #7270. # What changes are included in this PR? - Bump MSRV to 1.84 which was released more than 6 months ago - Removed half pins from CI # Are these changes tested? CI. # Are there any user-facing changes? Yes.
1 parent d534dd0 commit 9c0cb9a

File tree

39 files changed

+87
-111
lines changed

39 files changed

+87
-111
lines changed

.github/workflows/rust.yml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ on:
3030
pull_request:
3131

3232
jobs:
33-
3433
# Check workspace wide compile and test with default features for
3534
# mac
3635
macos:
@@ -54,7 +53,6 @@ jobs:
5453
# PyArrow tests happen in integration.yml.
5554
cargo test --workspace
5655
57-
5856
# Check workspace wide compile and test with default features for
5957
# windows
6058
windows:
@@ -84,8 +82,7 @@ jobs:
8482
# do not produce debug symbols to keep memory usage down
8583
export RUSTFLAGS="-C debuginfo=0"
8684
export PATH=$PATH:/d/protoc/bin
87-
cargo test --workspace
88-
85+
cargo test --workspace
8986
9087
# Run cargo fmt for all crates
9188
lint:
@@ -121,15 +118,6 @@ jobs:
121118
uses: ./.github/actions/setup-builder
122119
- name: Install cargo-msrv
123120
run: cargo install cargo-msrv
124-
- name: Downgrade arrow-pyarrow-integration-testing dependencies
125-
working-directory: arrow-pyarrow-integration-testing
126-
# Necessary because half 2.5 requires rust 1.81 or newer
127-
run: |
128-
cargo update -p half --precise 2.4.0
129-
- name: Downgrade workspace dependencies
130-
# Necessary because half 2.5 requires rust 1.81 or newer
131-
run: |
132-
cargo update -p half --precise 2.4.0
133121
- name: Check all packages
134122
run: |
135123
# run `cargo msrv verify --manifest-path "path/to/Cargo.toml"` to see problematic dependencies

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ include = [
8181
"NOTICE.txt",
8282
]
8383
edition = "2021"
84-
rust-version = "1.81"
84+
rust-version = "1.84"
8585

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

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

README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,10 @@ Planned Release Schedule
7979

8080
### Rust Version Compatibility Policy
8181

82-
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.
82+
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.
8383

8484
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.
8585

86-
E.g.
87-
88-
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.
89-
9086
### Guidelines for `panic` vs `Result`
9187

9288
In general, use panics for bad states that are unreachable, unrecoverable or harmful.

arrow-array/benches/union_array.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,7 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18-
use std::{
19-
hint,
20-
iter::{repeat, repeat_with},
21-
sync::Arc,
22-
};
18+
use std::{hint, iter::repeat_with, sync::Arc};
2319

2420
use arrow_array::{Array, ArrayRef, Int32Array, UnionArray};
2521
use arrow_buffer::{NullBuffer, ScalarBuffer};
@@ -67,9 +63,8 @@ fn criterion_benchmark(c: &mut Criterion) {
6763
fields,
6864
type_ids.cycle().take(4096).collect(),
6965
None,
70-
repeat(array_with_nulls())
71-
.take(with_nulls as usize)
72-
.chain(repeat(array_without_nulls()).take(without_nulls as usize))
66+
std::iter::repeat_n(array_with_nulls(), with_nulls as usize)
67+
.chain(std::iter::repeat_n(array_without_nulls(), without_nulls as usize))
7368
.collect(),
7469
)
7570
.unwrap();

arrow-array/src/arithmetic.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -420,13 +420,13 @@ native_type_float_op!(
420420
1.,
421421
unsafe {
422422
// Need to allow in clippy because
423-
// current MSRV (Minimum Supported Rust Version) is `1.81.0` but this item is stable since `1.87.0`
423+
// current MSRV (Minimum Supported Rust Version) is `1.84.0` but this item is stable since `1.87.0`
424424
#[allow(unnecessary_transmutes)]
425425
std::mem::transmute(-1_i32)
426426
},
427427
unsafe {
428428
// Need to allow in clippy because
429-
// current MSRV (Minimum Supported Rust Version) is `1.81.0` but this item is stable since `1.87.0`
429+
// current MSRV (Minimum Supported Rust Version) is `1.84.0` but this item is stable since `1.87.0`
430430
#[allow(unnecessary_transmutes)]
431431
std::mem::transmute(i32::MAX)
432432
}
@@ -437,13 +437,13 @@ native_type_float_op!(
437437
1.,
438438
unsafe {
439439
// Need to allow in clippy because
440-
// current MSRV (Minimum Supported Rust Version) is `1.81.0` but this item is stable since `1.87.0`
440+
// current MSRV (Minimum Supported Rust Version) is `1.84.0` but this item is stable since `1.87.0`
441441
#[allow(unnecessary_transmutes)]
442442
std::mem::transmute(-1_i64)
443443
},
444444
unsafe {
445445
// Need to allow in clippy because
446-
// current MSRV (Minimum Supported Rust Version) is `1.81.0` but this item is stable since `1.87.0`
446+
// current MSRV (Minimum Supported Rust Version) is `1.84.0` but this item is stable since `1.87.0`
447447
#[allow(unnecessary_transmutes)]
448448
std::mem::transmute(i64::MAX)
449449
}

arrow-array/src/array/list_array.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ impl<OffsetSize: OffsetSizeTrait> From<FixedSizeListArray> for GenericListArray<
454454
_ => unreachable!(),
455455
};
456456

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

459459
Self {
460460
data_type: Self::DATA_TYPE_CONSTRUCTOR(field.clone()),

arrow-array/src/array/list_view_array.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ impl<OffsetSize: OffsetSizeTrait> From<FixedSizeListArray> for GenericListViewAr
475475
_ => unreachable!(),
476476
};
477477
let mut acc = 0_usize;
478-
let iter = std::iter::repeat(size).take(value.len());
478+
let iter = std::iter::repeat_n(size, value.len());
479479
let mut sizes = Vec::with_capacity(iter.size_hint().0);
480480
let mut offsets = Vec::with_capacity(iter.size_hint().0);
481481

arrow-avro/src/reader/record.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ impl Decoder {
338338
moff.push_length(0);
339339
}
340340
Self::Fixed(sz, accum) => {
341-
accum.extend(std::iter::repeat(0u8).take(*sz as usize));
341+
accum.extend(std::iter::repeat_n(0u8, *sz as usize));
342342
}
343343
Self::Decimal128(_, _, _, builder) => builder.append_value(0),
344344
Self::Decimal256(_, _, _, builder) => builder.append_value(i256::ZERO),

arrow-buffer/src/buffer/immutable.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -997,13 +997,13 @@ mod tests {
997997
#[should_panic(expected = "capacity overflow")]
998998
fn test_from_iter_overflow() {
999999
let iter_len = usize::MAX / std::mem::size_of::<u64>() + 1;
1000-
let _ = Buffer::from_iter(std::iter::repeat(0_u64).take(iter_len));
1000+
let _ = Buffer::from_iter(std::iter::repeat_n(0_u64, iter_len));
10011001
}
10021002

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

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

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

10411041
let buffer2 = buffer.clone();

arrow-buffer/src/builder/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub use null::*;
2626
pub use offset::*;
2727

2828
use crate::{ArrowNativeType, Buffer, MutableBuffer};
29-
use std::{iter, marker::PhantomData};
29+
use std::marker::PhantomData;
3030

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

220220
/// Appends `n`, zero-initialized values

0 commit comments

Comments
 (0)