Skip to content

Conversation

@timsaucer
Copy link
Member

@timsaucer timsaucer commented Dec 15, 2025

Which issue does this PR close?

This addresses part of #15804 but does not close it.

Rationale for this change

Now that we are on MSRV 1.88 we can use rust edition 2024, which brings let chains and other nice features. It also improves unsafe checking. In order to introduce these changes in slower way instead of one massive PR that is too difficult to manage we are updating a few crates at a time.

What changes are included in this PR?

Updates these crates to 2024.

  • datafusion

Are these changes tested?

Existing unit tests. There are no functional code changes.

Are there any user-facing changes?

None.

Note

It is recommended to review with the ignore whitespace setting: https://github.com/apache/datafusion/pull/19332/files?w=1

@timsaucer
Copy link
Member Author

I broke from the original plan and did just this one crate since it is such a large diff.

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Looks good to me -- thanks @timsaucer

readme = "../../README.md"
version = { workspace = true }
edition = { workspace = true }
edition = "2024"
Copy link
Contributor

Choose a reason for hiding this comment

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

🎉

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the datafusion-core crate to Rust 2024 edition as part of a gradual migration strategy. The changes are purely stylistic and leverage Rust 2024 features like let chains while maintaining backward compatibility.

Key Changes:

  • Edition update in Cargo.toml from 2021 to 2024
  • Import reordering to follow rustfmt 2024 conventions
  • Adoption of let chains to simplify nested if-let patterns
  • Code formatting improvements (line breaks, alignment)

Reviewed changes

Copilot reviewed 128 out of 129 changed files in this pull request and generated no comments.

Show a summary per file
File Description
datafusion/core/Cargo.toml Updates edition from workspace default to "2024"
Test files (user_defined/*.rs) Import reordering and let chains adoption
Test files (sql/.rs, physical_optimizer/.rs) Formatting improvements, let chains, and import sorting
Test files (parquet/.rs, fuzz_cases/.rs) Pattern matching updates and formatting consistency
Core source files (src/*.rs) Import reordering, let chains, and code formatting
Benchmark files (benches/*.rs) Import statement reordering and variable renaming

All changes are non-functional and maintain existing behavior while taking advantage of Rust 2024 edition features. The migration follows best practices by updating a single crate incrementally rather than attempting a large-scale change across the entire codebase.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@timsaucer timsaucer force-pushed the chore/upgrade-rust-2024-group-7 branch from b2c7f1f to 673dac8 Compare December 16, 2025 14:28
@github-actions github-actions bot added the core Core DataFusion crate label Dec 16, 2025
@timsaucer timsaucer force-pushed the chore/upgrade-rust-2024-group-7 branch from 673dac8 to f59ee9a Compare December 16, 2025 14:31
@timsaucer timsaucer added this pull request to the merge queue Dec 16, 2025
Merged via the queue into apache:main with commit 775277a Dec 16, 2025
14 checks passed
@timsaucer timsaucer deleted the chore/upgrade-rust-2024-group-7 branch December 16, 2025 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Core DataFusion crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants