diff options
| author | bors <bors@rust-lang.org> | 2021-01-22 14:04:31 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-01-22 14:04:31 +0000 |
| commit | fbc374d0a6d9824e3174a0038dc5c258f6729020 (patch) | |
| tree | 1e81f0613dbbb58192d51408f4b683e44eb4073b | |
| parent | 043cf97abc51bdb6df728d57957f1d194d988475 (diff) | |
| parent | 23662d1353a52be7c35bb3905337f2aadf7c504a (diff) | |
| download | rust-fbc374d0a6d9824e3174a0038dc5c258f6729020.tar.gz rust-fbc374d0a6d9824e3174a0038dc5c258f6729020.zip | |
Auto merge of #6621 - giraffate:improve_the_example_in_ref_in_deref, r=flip1995
Improve the example in `ref_in_deref` Add a suggested code to the example in doc changelog: none
| -rw-r--r-- | clippy_lints/src/reference.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clippy_lints/src/reference.rs b/clippy_lints/src/reference.rs index 2dfb947b5eb..e1450466a7c 100644 --- a/clippy_lints/src/reference.rs +++ b/clippy_lints/src/reference.rs @@ -111,6 +111,12 @@ declare_clippy_lint! { /// let point = Point(30, 20); /// let x = (&point).0; /// ``` + /// Use instead: + /// ```rust + /// # struct Point(u32, u32); + /// # let point = Point(30, 20); + /// let x = point.0; + /// ``` pub REF_IN_DEREF, complexity, "Use of reference in auto dereference expression." |
