rust/tests
bors 7c34ec8947 Auto merge of #10896 - y21:eager-or-lazy-autoderef, r=blyxyas,xFrednet
consider autoderef through user-defined `Deref` in `eager_or_lazy`

Fixes #10462

This PR handles autoderef in the `eager_or_lazy` util module and stops suggesting to change lazy to eager if autoderef in an expression goes through user defined `Deref` impls, e.g.
```rs
struct S;
impl Deref for S {
  type Target = ();
  fn deref(&self) -> &Self::Target { &() }
}

let _ = Some(()).as_ref().unwrap_or_else(|| &S); // autoderef `&S` -> `&()`
```

changelog: [`unnecessary_lazy_evaluations`]: don't suggest changing lazy evaluation to eager if autoderef goes through user-defined `Deref`

r? `@xFrednet`  (because of the earlier review in #10864, might help for context here)
2023-06-07 07:14:12 +00:00
..
test_utils
ui Auto merge of #10896 - y21:eager-or-lazy-autoderef, r=blyxyas,xFrednet 2023-06-07 07:14:12 +00:00
ui-cargo Address Dependabot alerts 2023-05-24 22:08:43 +09:00
ui-internal refactor(test): Move attribute to lint level 2023-06-03 00:00:45 +05:30
ui-toml Auto merge of #10607 - beetrees:toml-spans, r=giraffate 2023-06-02 08:01:31 +00:00
workspace_test
check-fmt.rs
clippy.toml
compile-test.rs
dogfood.rs
headers.rs
integration.rs
lint_message_convention.rs
missing-test-files.rs
versioncheck.rs
workspace.rs