diff --git a/Cargo.toml b/Cargo.toml index c5a1aa9c8ef8..1d882817acc7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -126,3 +126,7 @@ opt-level = 3 overflow-checks = false panic = 'unwind' rpath = false + +[workspace.lints.clippy] +# Detects large stack-allocated futures that may cause stack overflow crashes (see threshold in clippy.toml) +large_futures = "warn" diff --git a/benchmarks/Cargo.toml b/benchmarks/Cargo.toml index a9fbab1ce41f..ff8f4851f95b 100644 --- a/benchmarks/Cargo.toml +++ b/benchmarks/Cargo.toml @@ -26,6 +26,9 @@ repository = { workspace = true } license = { workspace = true } rust-version = { workspace = true } +[lints] +workspace = true + [features] ci = [] default = ["mimalloc"] diff --git a/clippy.toml b/clippy.toml index 62d8263085df..908f51664542 100644 --- a/clippy.toml +++ b/clippy.toml @@ -6,3 +6,7 @@ disallowed-methods = [ disallowed-types = [ { path = "std::time::Instant", reason = "Use `datafusion_common::instant::Instant` instead for WASM compatibility" }, ] + +# Lowering the threshold to help prevent stack overflows (default is 16384) +# See: https://rust-lang.github.io/rust-clippy/master/index.html#/large_futures +future-size-threshold = 10000 \ No newline at end of file diff --git a/datafusion-examples/Cargo.toml b/datafusion-examples/Cargo.toml index 4966143782ba..0074a2b8d40c 100644 --- a/datafusion-examples/Cargo.toml +++ b/datafusion-examples/Cargo.toml @@ -29,6 +29,9 @@ license = { workspace = true } authors = { workspace = true } rust-version = { workspace = true } +[lints] +workspace = true + [[example]] name = "flight_sql_server" path = "examples/flight/flight_sql_server.rs" diff --git a/datafusion/common-runtime/Cargo.toml b/datafusion/common-runtime/Cargo.toml index 7ed8b2cf2975..c10436087675 100644 --- a/datafusion/common-runtime/Cargo.toml +++ b/datafusion/common-runtime/Cargo.toml @@ -28,6 +28,9 @@ license = { workspace = true } authors = { workspace = true } rust-version = { workspace = true } +[lints] +workspace = true + [lib] name = "datafusion_common_runtime" path = "src/lib.rs" diff --git a/datafusion/common/Cargo.toml b/datafusion/common/Cargo.toml index 167307f37108..2391b2f83087 100644 --- a/datafusion/common/Cargo.toml +++ b/datafusion/common/Cargo.toml @@ -28,6 +28,9 @@ license = { workspace = true } authors = { workspace = true } rust-version = { workspace = true } +[lints] +workspace = true + [lib] name = "datafusion_common" path = "src/lib.rs" diff --git a/datafusion/core/Cargo.toml b/datafusion/core/Cargo.toml index 3ee6471ca966..2bd552aacc44 100644 --- a/datafusion/core/Cargo.toml +++ b/datafusion/core/Cargo.toml @@ -32,6 +32,9 @@ authors = { workspace = true } # https://github.com/foresterre/cargo-msrv/issues/590 rust-version = "1.73" +[lints] +workspace = true + [lib] name = "datafusion" path = "src/lib.rs" diff --git a/datafusion/execution/Cargo.toml b/datafusion/execution/Cargo.toml index 84c878bf10dc..a00b3354eb73 100644 --- a/datafusion/execution/Cargo.toml +++ b/datafusion/execution/Cargo.toml @@ -28,6 +28,9 @@ license = { workspace = true } authors = { workspace = true } rust-version = { workspace = true } +[lints] +workspace = true + [lib] name = "datafusion_execution" path = "src/lib.rs" diff --git a/datafusion/expr/Cargo.toml b/datafusion/expr/Cargo.toml index 6f6147d36883..2759572581ea 100644 --- a/datafusion/expr/Cargo.toml +++ b/datafusion/expr/Cargo.toml @@ -28,6 +28,9 @@ license = { workspace = true } authors = { workspace = true } rust-version = { workspace = true } +[lints] +workspace = true + [lib] name = "datafusion_expr" path = "src/lib.rs" diff --git a/datafusion/functions-aggregate/Cargo.toml b/datafusion/functions-aggregate/Cargo.toml index d42932d8abdd..be354acb4851 100644 --- a/datafusion/functions-aggregate/Cargo.toml +++ b/datafusion/functions-aggregate/Cargo.toml @@ -28,6 +28,9 @@ license = { workspace = true } authors = { workspace = true } rust-version = { workspace = true } +[lints] +workspace = true + [lib] name = "datafusion_functions_aggregate" path = "src/lib.rs" diff --git a/datafusion/functions-array/Cargo.toml b/datafusion/functions-array/Cargo.toml index 6ef9c6b055af..eb1ef9e03f31 100644 --- a/datafusion/functions-array/Cargo.toml +++ b/datafusion/functions-array/Cargo.toml @@ -28,6 +28,9 @@ license = { workspace = true } authors = { workspace = true } rust-version = { workspace = true } +[lints] +workspace = true + [features] [lib] diff --git a/datafusion/functions/Cargo.toml b/datafusion/functions/Cargo.toml index f9985069413b..577ecdb7461d 100644 --- a/datafusion/functions/Cargo.toml +++ b/datafusion/functions/Cargo.toml @@ -28,6 +28,9 @@ license = { workspace = true } authors = { workspace = true } rust-version = { workspace = true } +[lints] +workspace = true + [features] # enable core functions core_expressions = [] diff --git a/datafusion/optimizer/Cargo.toml b/datafusion/optimizer/Cargo.toml index 2b96d0bc5626..b1a6953501a6 100644 --- a/datafusion/optimizer/Cargo.toml +++ b/datafusion/optimizer/Cargo.toml @@ -28,6 +28,9 @@ license = { workspace = true } authors = { workspace = true } rust-version = { workspace = true } +[lints] +workspace = true + [lib] name = "datafusion_optimizer" path = "src/lib.rs" diff --git a/datafusion/physical-expr-common/Cargo.toml b/datafusion/physical-expr-common/Cargo.toml index 89a41a5d10ce..d1202c83d526 100644 --- a/datafusion/physical-expr-common/Cargo.toml +++ b/datafusion/physical-expr-common/Cargo.toml @@ -28,6 +28,9 @@ license = { workspace = true } authors = { workspace = true } rust-version = { workspace = true } +[lints] +workspace = true + [lib] name = "datafusion_physical_expr_common" path = "src/lib.rs" diff --git a/datafusion/physical-expr/Cargo.toml b/datafusion/physical-expr/Cargo.toml index fe72a7a46fcb..5261f1c8968d 100644 --- a/datafusion/physical-expr/Cargo.toml +++ b/datafusion/physical-expr/Cargo.toml @@ -28,6 +28,9 @@ license = { workspace = true } authors = { workspace = true } rust-version = { workspace = true } +[lints] +workspace = true + [lib] name = "datafusion_physical_expr" path = "src/lib.rs" diff --git a/datafusion/physical-plan/Cargo.toml b/datafusion/physical-plan/Cargo.toml index 6863f2646000..25e1a6ad5bd3 100644 --- a/datafusion/physical-plan/Cargo.toml +++ b/datafusion/physical-plan/Cargo.toml @@ -28,6 +28,9 @@ license = { workspace = true } authors = { workspace = true } rust-version = { workspace = true } +[lints] +workspace = true + [lib] name = "datafusion_physical_plan" path = "src/lib.rs" diff --git a/datafusion/proto/Cargo.toml b/datafusion/proto/Cargo.toml index 325cd8704ccf..ecb41e4e263e 100644 --- a/datafusion/proto/Cargo.toml +++ b/datafusion/proto/Cargo.toml @@ -32,6 +32,9 @@ rust-version = "1.73" # Exclude proto files so crates.io consumers don't need protoc exclude = ["*.proto"] +[lints] +workspace = true + [lib] name = "datafusion_proto" path = "src/lib.rs" diff --git a/datafusion/proto/gen/Cargo.toml b/datafusion/proto/gen/Cargo.toml index 01ce92ee9e8e..ca93706419e4 100644 --- a/datafusion/proto/gen/Cargo.toml +++ b/datafusion/proto/gen/Cargo.toml @@ -29,6 +29,9 @@ publish = false # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[lints] +workspace = true + [dependencies] # Pin these dependencies so that the generated output is deterministic pbjson-build = "=0.6.2" diff --git a/datafusion/sql/Cargo.toml b/datafusion/sql/Cargo.toml index b9f6dc259eb7..ef3ed265c7ab 100644 --- a/datafusion/sql/Cargo.toml +++ b/datafusion/sql/Cargo.toml @@ -28,6 +28,9 @@ license = { workspace = true } authors = { workspace = true } rust-version = { workspace = true } +[lints] +workspace = true + [lib] name = "datafusion_sql" path = "src/lib.rs" diff --git a/datafusion/sqllogictest/Cargo.toml b/datafusion/sqllogictest/Cargo.toml index 384c5b7153c3..c652c8041ff1 100644 --- a/datafusion/sqllogictest/Cargo.toml +++ b/datafusion/sqllogictest/Cargo.toml @@ -26,6 +26,9 @@ repository = { workspace = true } rust-version = { workspace = true } version = { workspace = true } +[lints] +workspace = true + [lib] name = "datafusion_sqllogictest" path = "src/lib.rs" diff --git a/datafusion/substrait/Cargo.toml b/datafusion/substrait/Cargo.toml index 37444e8632c7..ace8da906dc2 100644 --- a/datafusion/substrait/Cargo.toml +++ b/datafusion/substrait/Cargo.toml @@ -28,6 +28,9 @@ authors = { workspace = true } # Specify MSRV here as `cargo msrv` doesn't support workspace version rust-version = "1.73" +[lints] +workspace = true + [dependencies] async-recursion = "1.0" chrono = { workspace = true } diff --git a/datafusion/wasmtest/Cargo.toml b/datafusion/wasmtest/Cargo.toml index 2f8521b19b74..46e157aecfd9 100644 --- a/datafusion/wasmtest/Cargo.toml +++ b/datafusion/wasmtest/Cargo.toml @@ -27,6 +27,9 @@ license = { workspace = true } authors = { workspace = true } rust-version = { workspace = true } +[lints] +workspace = true + [lib] crate-type = ["cdylib", "rlib"] diff --git a/docs/Cargo.toml b/docs/Cargo.toml index d5e114075c95..14398c841579 100644 --- a/docs/Cargo.toml +++ b/docs/Cargo.toml @@ -28,5 +28,8 @@ license = { workspace = true } authors = { workspace = true } rust-version = { workspace = true } +[lints] +workspace = true + [dependencies] datafusion = { workspace = true } diff --git a/test-utils/Cargo.toml b/test-utils/Cargo.toml index 1e86457f844a..325a2cc2fcc4 100644 --- a/test-utils/Cargo.toml +++ b/test-utils/Cargo.toml @@ -22,6 +22,9 @@ edition = { workspace = true } # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[lints] +workspace = true + [dependencies] arrow = { workspace = true } datafusion-common = { workspace = true, default-features = true }