Improve the example in ref_in_deref

This commit is contained in:
Takayuki Nakata 2021-01-22 22:51:06 +09:00
parent 043cf97abc
commit 23662d1353

View File

@ -111,6 +111,12 @@ fn check_expr(&mut self, cx: &EarlyContext<'_>, e: &Expr) {
/// 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."