This is an automated email from the ASF dual-hosted git repository.
lidavidm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-adbc.git
The following commit(s) were added to refs/heads/main by this push:
new 86cba9a0d refactor(rust)!: not to mark some enums as `non_exhaustive`
(#3245)
86cba9a0d is described below
commit 86cba9a0d61fe212e14f241fff0ac1df6fe3ccd2
Author: eitsupi <[email protected]>
AuthorDate: Wed Aug 20 09:51:47 2025 +0900
refactor(rust)!: not to mark some enums as `non_exhaustive` (#3245)
As discussed in #3197, some enums should not be marked as
`non_exhaustive` because they are unlikely to be expanded in the future
without breaking changes.
One of the exceptions is `AdbcVersion`, but on our side, if this is
extended we have to make sure to change adbc_driver_manager as well, so
we also have to run the unstable `non_exhaustive_omitted_patterns` lint
with nightly toolchain.
---
.github/workflows/rust.yml | 8 +++++++-
rust/core/src/error.rs | 1 -
rust/core/src/options.rs | 4 ----
3 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml
index 84d67a8a8..c6446b682 100644
--- a/.github/workflows/rust.yml
+++ b/.github/workflows/rust.yml
@@ -160,10 +160,16 @@ jobs:
- name: Set search dir for Snowflake Go lib
run: echo "ADBC_SNOWFLAKE_GO_LIB_DIR=${{ github.workspace
}}/local/lib" >> "$GITHUB_ENV"
- name: Clippy
- if: ${{ ! matrix.minimal-versions }}
+ if: runner.os != 'Linux' && ! matrix.minimal-versions
working-directory: rust
run: |
cargo clippy --workspace --all-targets --all-features --locked --
-Dwarnings
+ - name: Clippy (nightly)
+ if: runner.os == 'Linux' && ! matrix.minimal-versions
+ working-directory: rust
+ run: |
+ rustup toolchain install nightly --component clippy
+ cargo +nightly clippy --workspace --all-targets --all-features
--locked -- -Dwarnings
-Zcrate-attr='feature(non_exhaustive_omitted_patterns_lint)'
- name: Test
working-directory: rust
# TODO: enable snowflake tests on windows
diff --git a/rust/core/src/error.rs b/rust/core/src/error.rs
index 67d2113f4..3e83a0695 100644
--- a/rust/core/src/error.rs
+++ b/rust/core/src/error.rs
@@ -24,7 +24,6 @@ use arrow_schema::ArrowError;
/// Status of an operation.
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
-#[non_exhaustive]
pub enum Status {
/// No error.
Ok,
diff --git a/rust/core/src/options.rs b/rust/core/src/options.rs
index 7e3e443bd..c07f26e36 100644
--- a/rust/core/src/options.rs
+++ b/rust/core/src/options.rs
@@ -232,7 +232,6 @@ impl TryFrom<u32> for InfoCode {
/// Depth parameter for [get_objects][crate::Connection::get_objects] method.
#[derive(Debug)]
-#[non_exhaustive]
pub enum ObjectDepth {
/// Catalogs, schemas, tables, and columns.
All,
@@ -462,7 +461,6 @@ impl From<&str> for OptionStatement {
/// Isolation level value for key [OptionConnection::IsolationLevel].
#[derive(Debug)]
-#[non_exhaustive]
pub enum IsolationLevel {
/// Use database or driver default isolation level.
Default,
@@ -538,7 +536,6 @@ impl From<IsolationLevel> for OptionValue {
/// Ingestion mode value for key [OptionStatement::IngestMode].
#[derive(Debug)]
-#[non_exhaustive]
pub enum IngestMode {
/// Create the table and insert data; error if the table exists.
Create,
@@ -581,7 +578,6 @@ impl From<IngestMode> for OptionValue {
/// Statistics about the data distribution.
#[derive(Debug, Clone)]
-#[non_exhaustive]
pub enum Statistics {
/// The average byte width statistic. The average size in bytes of a row in
/// the column. Value type is `float64`. For example, this is roughly the