RS.CLIPPY.INIT_NUMBERED_FIELDS
Numbered fields in tuple struct initializer
This checker is a Clippy lint created by The Rust Project Contributors. The documentation shown here is a copy of the original documentation for: init_numbered_fields. Copyright ©2025 The Rust Team. All rights reserved.
What it does
Checks for tuple structs initialized with field syntax. It will however not lint if a base initializer is present. The lint will also ignore code in macros.
Why is this bad?
This may be confusing to the uninitiated and adds no benefit as opposed to tuple initializers
Example
struct TupleStruct(u8, u16);
let _ = TupleStruct {
0: 1,
1: 23,
};
// should be written as
let base = TupleStruct(1, 23);
// This is OK however
let _ = TupleStruct { 0: 42, ..base };