rust/tests
bors 1807580a49 Auto merge of #12772 - phi-gamma:redundant-struct-recreation, r=y21
add lint for recreation of an entire struct

This lint makes Clippy warn about situations where an owned struct is
essentially recreated by moving all its fields into a new instance of
the struct. The lint is not machine-applicable because the source
struct may have been partially moved.

This lint originated in something I spotted during peer review. While
working on their branch a colleague ended up with a commit where a
function returned a struct that 1:1 replicated one of its owned inputs
from its members. Initially I suspected they hadn’t run their code
through Clippy but AFAICS there is no lint for this situation yet.

changelog: new lint: [`redundant_owned_struct_recreation`]

### New lint checklist

- \[+] Followed [lint naming conventions][lint_naming]
- \[+] Added passing UI tests (including committed `.stderr` file)
- \[+] `cargo test` passes locally
- \[+] Executed `cargo dev update_lints`
- \[+] Added lint documentation
- \[+] Run `cargo dev fmt`
2024-07-21 23:02:38 +00:00
..
test_utils
ui Auto merge of #12772 - phi-gamma:redundant-struct-recreation, r=y21 2024-07-21 23:02:38 +00:00
ui-cargo
ui-internal Refactor for using config values: 2024-07-17 14:05:49 -04:00
ui-toml Refactor for using config values: 2024-07-17 14:05:49 -04:00
workspace_test
check-fmt.rs
clippy.toml
compile-test.rs Bump clippy version 2024-07-15 08:51:04 +00:00
dogfood.rs Show progress while running dogfood test 2024-07-17 12:29:18 +00:00
headers.rs
integration.rs [pathbuf_init_then_push]: Checks for calls to push immediately after creating a new PathBuf 2024-07-21 14:22:48 +08:00
lint_message_convention.rs
missing-test-files.rs
versioncheck.rs
workspace.rs