rust/tests
bors e669d97494 Auto merge of #12706 - pacak:less-aggressive-needless-borrows, r=dswij
less aggressive needless_borrows_for_generic_args

Current implementation looks for significant drops, that can change the behavior, but that's not enough - value might not have a `Drop` itself but one of its children might have it.

A good example is passing a reference to `PathBuf` to `std::fs::File::open`. There's no benefits to pass `PathBuf` by value, but since `clippy` can't see `Drop` on `Vec` several layers down it complains forcing pass by value and making it impossible to use the same name later.

New implementation only looks at copy values or values created in place     so existing variable will never be moved but things that take a string reference created and value is created inplace `&"".to_owned()` will make it to suggest to use `"".to_owned()` still.

Fixes https://github.com/rust-lang/rust-clippy/issues/12454

changelog: [`needless_borrows_for_generic_args`]: avoid moving variables
2024-05-15 15:51:27 +00:00
..
test_utils
ui Auto merge of #12706 - pacak:less-aggressive-needless-borrows, r=dswij 2024-05-15 15:51:27 +00:00
ui-cargo Lint direct priority conflicts in [lints.workspace] 2024-04-28 14:16:19 +00:00
ui-internal Merge commit 'ca3b393750ee8d870bf3215dcf6509cafa5c0445' into clippy-subtree-update 2024-04-18 17:48:52 +02:00
ui-toml new lint: macro_metavars_in_unsafe 2024-05-12 17:03:30 +02:00
workspace_test
check-fmt.rs
clippy.toml
compile-test.rs Bump ui_test to 0.23 2024-05-02 12:44:40 +02:00
dogfood.rs
headers.rs
integration.rs
lint_message_convention.rs
missing-test-files.rs
versioncheck.rs
workspace.rs