Skip to content

Commit 7bfc594

Browse files
emilkclaude
andcommitted
feat: enable a batch of non-default clippy lints workspace-wide
All of these are already violation-free across the workspace, so this is pure future-proofing: they only fire on newly written code. They are a subset of the lint set used by https://github.com/emilk/egui, picked because they trigger no (or almost no) violations in DataFusion today. The single existing violation is a deliberate `mem::forget` in an FFI test helper, now marked with `#[expect]`. Part of apache#18467 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
1 parent 31ffab1 commit 7bfc594

2 files changed

Lines changed: 52 additions & 0 deletions

File tree

‎Cargo.toml‎

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,20 +210,71 @@ uuid = "1.23"
210210
zstd = { version = "0.13", default-features = false }
211211

212212
# Keep this list sorted alphabetically.
213+
# See https://github.com/apache/datafusion/issues/18467 for the ongoing effort of
214+
# picking useful non-default lints.
213215
[workspace.lints.clippy]
214216
# https://github.com/apache/datafusion/issues/18881
215217
allow_attributes = "warn"
218+
as_ptr_cast_mut = "warn"
216219
assigning_clones = "warn"
220+
char_lit_as_u8 = "warn"
221+
clear_with_drain = "warn"
222+
coerce_container_to_any = "warn"
223+
decimal_bitwise_operands = "warn"
224+
default_union_representation = "warn"
225+
empty_enum_variants_with_brackets = "warn"
226+
empty_line_after_outer_attr = "warn"
227+
exit = "warn"
228+
fn_to_numeric_cast_any = "warn"
229+
if_let_mutex = "warn"
230+
imprecise_flops = "warn"
231+
index_refutable_slice = "warn"
217232
inefficient_to_string = "warn"
233+
infinite_loop = "warn"
234+
invalid_upcast_comparisons = "warn"
235+
ip_constant = "warn"
236+
iter_filter_is_ok = "warn"
237+
iter_filter_is_some = "warn"
238+
iter_on_empty_collections = "warn"
218239
# Detects large stack-allocated futures that may cause stack overflow crashes (see threshold in clippy.toml)
219240
large_futures = "warn"
241+
large_include_file = "warn"
242+
macro_use_imports = "warn"
243+
manual_ilog2 = "warn"
244+
manual_is_power_of_two = "warn"
245+
manual_ok_or = "warn"
246+
match_wild_err_arm = "warn"
247+
mem_forget = "warn"
248+
mismatching_type_param_order = "warn"
249+
missing_enforced_import_renames = "warn"
250+
mut_mut = "warn"
251+
mutex_integer = "warn"
220252
# https://github.com/apache/datafusion/issues/18503
221253
needless_pass_by_value = "warn"
254+
negative_feature_names = "warn"
255+
non_zero_suggestions = "warn"
256+
nonstandard_macro_braces = "warn"
222257
or_fun_call = "warn"
258+
path_buf_push_overwrite = "warn"
259+
precedence_bits = "warn"
260+
pub_underscore_fields = "warn"
261+
rc_mutex = "warn"
262+
same_length_and_capacity = "warn"
263+
string_add_assign = "warn"
264+
suspicious_command_arg_space = "warn"
265+
suspicious_xor_used_as_pow = "warn"
266+
trailing_empty_array = "warn"
267+
transmute_ptr_to_ptr = "warn"
268+
uninhabited_references = "warn"
223269
uninlined_format_args = "warn"
224270
unnecessary_lazy_evaluations = "warn"
271+
unnecessary_self_imports = "warn"
225272
unused_async = "warn"
273+
unused_rounding = "warn"
226274
used_underscore_binding = "warn"
275+
useless_transmute = "warn"
276+
wildcard_dependencies = "warn"
277+
zero_sized_map_values = "warn"
227278

228279
[workspace.lints.rust]
229280
unexpected_cfgs = { level = "warn", check-cfg = [

‎datafusion/ffi/src/tests/utils.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ pub fn get_module() -> Result<ForeignLibraryModule> {
8383
assert_eq!((module.version)(), expected_version);
8484

8585
// Leak the library to keep it loaded for the duration of the test
86+
#[expect(clippy::mem_forget)]
8687
std::mem::forget(lib);
8788

8889
Ok(module)

0 commit comments

Comments
 (0)