From 6346c4e0f532956a488697ff3155ee455998e933 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Fri, 27 Sep 2024 09:33:30 -0700 Subject: [PATCH] Ignore used_underscore_items pedantic clippy lint in test warning: used underscore-prefixed item --> tests/test_const.rs:5:20 | 5 | const _BASIC: () = _basic(); | ^^^^^^^^ | note: item is defined here --> tests/test_const.rs:3:28 | 3 | #[rustversion::attr(all(), const)] | ____________________________^ 4 | | fn _basic() {} | |___________^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#used_underscore_items = note: `-W clippy::used-underscore-items` implied by `-W clippy::pedantic` = help: to override `-W clippy::pedantic` add `#[allow(clippy::used_underscore_items)]` warning: used underscore-prefixed item --> tests/test_const.rs:9:30 | 9 | const _UNSAFE: () = unsafe { _unsafe() }; | ^^^^^^^^^ | note: item is defined here --> tests/test_const.rs:7:28 | 7 | #[rustversion::attr(all(), const)] | ____________________________^ 8 | | unsafe fn _unsafe() {} | |___________________^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#used_underscore_items warning: used underscore-prefixed item --> tests/test_const.rs:34:24 | 34 | const _DOC_BELOW: () = _doc_below(); | ^^^^^^^^^^^^ | note: item is defined here --> tests/test_const.rs:31:28 | 31 | #[rustversion::attr(all(), const)] | ____________________________^ 32 | | /// doc 33 | | fn _doc_below() {} | |_______________^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#used_underscore_items warning: used underscore-prefixed item --> tests/test_const.rs:39:24 | 39 | const _DOC_ABOVE: () = _doc_above(); | ^^^^^^^^^^^^ | note: item is defined here --> tests/test_const.rs:37:28 | 37 | #[rustversion::attr(all(), const)] | ____________________________^ 38 | | fn _doc_above() {} | |_______________^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#used_underscore_items --- tests/test_const.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/test_const.rs b/tests/test_const.rs index 3c4f7d5..0d0c7b8 100644 --- a/tests/test_const.rs +++ b/tests/test_const.rs @@ -1,4 +1,7 @@ -#![allow(clippy::semicolon_if_nothing_returned)] // https://github.com/rust-lang/rust-clippy/issues/7324 +#![allow( + clippy::semicolon_if_nothing_returned, // https://github.com/rust-lang/rust-clippy/issues/7324 + clippy::used_underscore_items, +)] #[rustversion::attr(all(), const)] fn _basic() {}