RS.CLIPPY.USED_UNDERSCORE_ITEMS
Using a item which is prefixed with an underscore
This checker is a Clippy lint created by The Rust Project Contributors. The documentation shown here is a copy of the original documentation for: used_underscore_items. Copyright ©2025 The Rust Team. All rights reserved.
What it does
Checks for the use of item with a single leading underscore.
Why is this bad?
A single leading underscore is usually used to indicate that a item will not be used. Using such a item breaks this expectation.
Example
fn _foo() {}
struct _FooStruct {}
fn main() {
_foo();
let _ = _FooStruct{};
}
Use instead:
fn foo() {}
struct FooStruct {}
fn main() {
foo();
let _ = FooStruct{};
}