mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 05:33:27 +00:00
7c34ec8947
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) |
||
---|---|---|
.. | ||
test_utils | ||
ui | ||
ui-cargo | ||
ui-internal | ||
ui-toml | ||
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 |