2023-10-17 16:34:27 +00:00
|
|
|
error: field name ends with the struct's name
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/struct_fields.rs:10:5
|
2023-10-17 16:34:27 +00:00
|
|
|
|
|
|
|
|
LL | field_data1: u8,
|
|
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= note: `-D clippy::struct-field-names` implied by `-D warnings`
|
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::struct_field_names)]`
|
|
|
|
|
|
|
|
error: field name starts with the struct's name
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/struct_fields.rs:20:5
|
2023-10-17 16:34:27 +00:00
|
|
|
|
|
|
|
|
LL | data2_field: u8,
|
|
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: all fields have the same postfix: `data`
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/struct_fields.rs:25:1
|
2023-10-17 16:34:27 +00:00
|
|
|
|
|
|
|
|
LL | / struct StructData {
|
|
|
|
LL | |
|
|
|
|
LL | | movable_data: u8,
|
|
|
|
LL | | fixed_data: u8,
|
|
|
|
LL | | invisible_data: u8,
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
|
|
|
|
|
|
|
|
= help: remove the postfixes
|
|
|
|
|
|
|
|
error: all fields have the same prefix: `data`
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/struct_fields.rs:32:1
|
2023-10-17 16:34:27 +00:00
|
|
|
|
|
|
|
|
LL | / struct DataStruct {
|
|
|
|
LL | |
|
|
|
|
LL | | data_movable: u8,
|
|
|
|
LL | | data_fixed: u8,
|
|
|
|
LL | | data_invisible: u8,
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
|
|
|
|
|
|
|
|
= help: remove the prefixes
|
|
|
|
|
|
|
|
error: all fields have the same prefix: `some_data`
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/struct_fields.rs:39:1
|
2023-10-17 16:34:27 +00:00
|
|
|
|
|
|
|
|
LL | / struct DoublePrefix {
|
|
|
|
LL | |
|
|
|
|
LL | | some_data_a: bool,
|
2024-01-05 15:44:41 +00:00
|
|
|
LL | | some_data_b: i8,
|
2023-10-17 16:34:27 +00:00
|
|
|
LL | | some_data_c: bool,
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
|
|
|
|
|
|
|
|
= help: remove the prefixes
|
|
|
|
|
|
|
|
error: all fields have the same postfix: `some_data`
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/struct_fields.rs:46:1
|
2023-10-17 16:34:27 +00:00
|
|
|
|
|
|
|
|
LL | / struct DoublePostfix {
|
|
|
|
LL | |
|
|
|
|
LL | | a_some_data: bool,
|
2024-01-05 15:44:41 +00:00
|
|
|
LL | | b_some_data: i8,
|
2023-10-17 16:34:27 +00:00
|
|
|
LL | | c_some_data: bool,
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
|
|
|
|
|
|
|
|
= help: remove the postfixes
|
|
|
|
|
|
|
|
error: all fields have the same postfix: `someData`
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/struct_fields.rs:54:1
|
2023-10-17 16:34:27 +00:00
|
|
|
|
|
|
|
|
LL | / struct NotSnakeCase {
|
|
|
|
LL | |
|
|
|
|
LL | | a_someData: bool,
|
2024-01-05 15:44:41 +00:00
|
|
|
LL | | b_someData: i8,
|
2023-10-17 16:34:27 +00:00
|
|
|
LL | | c_someData: bool,
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
|
|
|
|
|
|
|
|
= help: remove the postfixes
|
|
|
|
|
|
|
|
error: all fields have the same prefix: `someData`
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/struct_fields.rs:61:1
|
2023-10-17 16:34:27 +00:00
|
|
|
|
|
|
|
|
LL | / struct NotSnakeCase2 {
|
|
|
|
LL | |
|
|
|
|
LL | | someData_c: bool,
|
2024-01-05 15:44:41 +00:00
|
|
|
LL | | someData_b: i8,
|
2023-10-17 16:34:27 +00:00
|
|
|
LL | | someData_a_b: bool,
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
|
|
|
|
|
|
|
|
= help: remove the prefixes
|
|
|
|
|
|
|
|
error: all fields have the same prefix: `prefix`
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/struct_fields.rs:74:1
|
2023-10-17 16:34:27 +00:00
|
|
|
|
|
|
|
|
LL | / struct NonCaps {
|
|
|
|
LL | |
|
|
|
|
LL | | prefix_的: u8,
|
|
|
|
LL | | prefix_tea: u8,
|
|
|
|
LL | | prefix_cake: u8,
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
|
|
|
|
|
|
|
|
= help: remove the prefixes
|
|
|
|
|
|
|
|
error: all fields have the same prefix: `_type`
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/struct_fields.rs:124:5
|
2023-10-17 16:34:27 +00:00
|
|
|
|
|
|
|
|
LL | / struct DoLint {
|
|
|
|
LL | |
|
|
|
|
LL | | _type_create: u8,
|
|
|
|
LL | | _type_read: u8,
|
|
|
|
LL | | _type_update: u8,
|
|
|
|
LL | | _type_destroy: u8,
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
|
|
|
= help: remove the prefixes
|
|
|
|
|
|
|
|
error: all fields have the same prefix: `__type`
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/struct_fields.rs:132:5
|
2023-10-17 16:34:27 +00:00
|
|
|
|
|
|
|
|
LL | / struct DoLint2 {
|
|
|
|
LL | |
|
|
|
|
LL | | __type_create: u8,
|
|
|
|
LL | | __type_read: u8,
|
|
|
|
LL | | __type_update: u8,
|
|
|
|
LL | | __type_destroy: u8,
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
|
|
|
= help: remove the prefixes
|
|
|
|
|
|
|
|
error: all fields have the same prefix: `___type`
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/struct_fields.rs:140:5
|
2023-10-17 16:34:27 +00:00
|
|
|
|
|
|
|
|
LL | / struct DoLint3 {
|
|
|
|
LL | |
|
|
|
|
LL | | ___type_create: u8,
|
|
|
|
LL | | ___type_read: u8,
|
|
|
|
LL | | ___type_update: u8,
|
|
|
|
LL | | ___type_destroy: u8,
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
|
|
|
= help: remove the prefixes
|
|
|
|
|
|
|
|
error: all fields have the same postfix: `_`
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/struct_fields.rs:148:5
|
2023-10-17 16:34:27 +00:00
|
|
|
|
|
|
|
|
LL | / struct DoLint4 {
|
|
|
|
LL | |
|
|
|
|
LL | | create_: u8,
|
|
|
|
LL | | read_: u8,
|
|
|
|
LL | | update_: u8,
|
|
|
|
LL | | destroy_: u8,
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
|
|
|
= help: remove the postfixes
|
|
|
|
|
|
|
|
error: all fields have the same postfix: `__`
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/struct_fields.rs:156:5
|
2023-10-17 16:34:27 +00:00
|
|
|
|
|
|
|
|
LL | / struct DoLint5 {
|
|
|
|
LL | |
|
|
|
|
LL | | create__: u8,
|
|
|
|
LL | | read__: u8,
|
|
|
|
LL | | update__: u8,
|
|
|
|
LL | | destroy__: u8,
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
|
|
|
= help: remove the postfixes
|
|
|
|
|
|
|
|
error: all fields have the same postfix: `___`
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/struct_fields.rs:164:5
|
2023-10-17 16:34:27 +00:00
|
|
|
|
|
|
|
|
LL | / struct DoLint6 {
|
|
|
|
LL | |
|
|
|
|
LL | | create___: u8,
|
|
|
|
LL | | read___: u8,
|
|
|
|
LL | | update___: u8,
|
|
|
|
LL | | destroy___: u8,
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
|
|
|
= help: remove the postfixes
|
|
|
|
|
|
|
|
error: all fields have the same postfix: `type`
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/struct_fields.rs:172:5
|
2023-10-17 16:34:27 +00:00
|
|
|
|
|
|
|
|
LL | / struct DoLintToo {
|
|
|
|
LL | |
|
|
|
|
LL | | _create_type: u8,
|
|
|
|
LL | | _update_type: u8,
|
|
|
|
LL | | _delete_type: u8,
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
|
|
|
= help: remove the postfixes
|
|
|
|
|
|
|
|
error: field name starts with the struct's name
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/struct_fields.rs:210:5
|
2023-10-17 16:34:27 +00:00
|
|
|
|
|
|
|
|
LL | proxy: i32,
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
error: all fields have the same prefix: `some`
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/struct_fields.rs:226:13
|
2023-10-17 16:34:27 +00:00
|
|
|
|
|
|
|
|
LL | / struct MacroStruct {
|
2024-02-27 13:34:01 +00:00
|
|
|
LL | |
|
2023-10-17 16:34:27 +00:00
|
|
|
LL | | some_a: i32,
|
|
|
|
LL | | some_b: i32,
|
|
|
|
LL | | some_c: i32,
|
|
|
|
LL | | }
|
|
|
|
| |_____________^
|
|
|
|
...
|
|
|
|
LL | mk_struct!();
|
|
|
|
| ------------ in this macro invocation
|
|
|
|
|
|
|
|
|
= help: remove the prefixes
|
|
|
|
= note: this error originates in the macro `mk_struct` (in Nightly builds, run with -Z macro-backtrace for more info)
|
|
|
|
|
|
|
|
error: field name starts with the struct's name
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/struct_fields.rs:239:17
|
2023-10-17 16:34:27 +00:00
|
|
|
|
|
|
|
|
LL | macrobaz_a: i32,
|
|
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
...
|
|
|
|
LL | mk_struct2!();
|
|
|
|
| ------------- in this macro invocation
|
|
|
|
|
|
|
|
|
= note: this error originates in the macro `mk_struct2` (in Nightly builds, run with -Z macro-backtrace for more info)
|
|
|
|
|
|
|
|
error: field name starts with the struct's name
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/struct_fields.rs:251:17
|
2023-10-17 16:34:27 +00:00
|
|
|
|
|
|
|
|
LL | $field: i32,
|
|
|
|
| ^^^^^^^^^^^
|
|
|
|
...
|
|
|
|
LL | mk_struct_with_names!(Foo, foo);
|
|
|
|
| ------------------------------- in this macro invocation
|
|
|
|
|
|
|
|
|
= note: this error originates in the macro `mk_struct_with_names` (in Nightly builds, run with -Z macro-backtrace for more info)
|
|
|
|
|
|
|
|
error: all fields have the same prefix: `some`
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/struct_fields.rs:291:13
|
2023-10-17 16:34:27 +00:00
|
|
|
|
|
|
|
|
LL | / struct $struct_name {
|
2024-02-27 13:34:01 +00:00
|
|
|
LL | |
|
2023-10-17 16:34:27 +00:00
|
|
|
LL | | $field1: i32,
|
|
|
|
LL | | $field2: i32,
|
|
|
|
LL | | $field3: i32,
|
|
|
|
LL | | }
|
|
|
|
| |_____________^
|
|
|
|
...
|
|
|
|
LL | mk_struct_full_def!(PrefixData, some_data, some_meta, some_other);
|
|
|
|
| ----------------------------------------------------------------- in this macro invocation
|
|
|
|
|
|
|
|
|
= help: remove the prefixes
|
|
|
|
= note: this error originates in the macro `mk_struct_full_def` (in Nightly builds, run with -Z macro-backtrace for more info)
|
|
|
|
|
2024-01-05 15:44:41 +00:00
|
|
|
error: field name starts with the struct's name
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/struct_fields.rs:339:5
|
2024-01-05 15:44:41 +00:00
|
|
|
|
|
|
|
|
LL | use_foo: bool,
|
|
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: field name starts with the struct's name
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/struct_fields.rs:341:5
|
2024-01-05 15:44:41 +00:00
|
|
|
|
|
|
|
|
LL | use_bar: bool,
|
|
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: field name starts with the struct's name
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/struct_fields.rs:342:5
|
2024-01-05 15:44:41 +00:00
|
|
|
|
|
|
|
|
LL | use_baz: bool,
|
|
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: aborting due to 24 previous errors
|
2023-10-17 16:34:27 +00:00
|
|
|
|