From 583939ec0c8ee9c523cc60342d3d979ce6730f38 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Sat, 8 Aug 2026 18:04:04 +0900 Subject: [PATCH] codegen: Ignore clippy::assert_is_empty lint ``` error: used `assert!` to check that a value is not empty --> tools/codegen/src/lib.rs:54:13 | 54 | assert!(!bin.as_slice().is_empty()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assert_is_empty = note: `-D clippy::assert-is-empty` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::assert_is_empty)]` help: use `assert_ne!` to show the value on failure | 54 - assert!(!bin.as_slice().is_empty()); 54 + assert_ne!(bin.as_slice(), []); | ``` --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Cargo.toml b/Cargo.toml index ee50c5e2..fcb08970 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,6 +28,7 @@ transmute_undefined_repr = "warn" undocumented_unsafe_blocks = "warn" unused_trait_names = "warn" # Suppress buggy or noisy clippy lints +assert_is_empty = { level = "allow", priority = 1 } # completely useless in assert_ne case bool_assert_comparison = { level = "allow", priority = 1 } borrow_as_ptr = { level = "allow", priority = 1 } # https://github.com/rust-lang/rust-clippy/issues/8286 cast_lossless = { level = "allow", priority = 1 } # suggested code has poor codegen with -C opt-level=0 https://godbolt.org/z/GzTxzbd9q