X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=clippy_lints%2Fsrc%2Fborrow_deref_ref.rs;h=c4520d003928e3832053fe749045c643407ed2c1;hb=a85c8f33ff0da5192bb44ac52cb838f638ad7c03;hp=1582ec9ee5ce6e21776768a16d4b4159c0450795;hpb=f8f9d01c2ad0dff565bdd60feeb4cbd09dada8cd;p=rust.git diff --git a/clippy_lints/src/borrow_deref_ref.rs b/clippy_lints/src/borrow_deref_ref.rs index 1582ec9ee5c..c4520d00392 100644 --- a/clippy_lints/src/borrow_deref_ref.rs +++ b/clippy_lints/src/borrow_deref_ref.rs @@ -22,29 +22,24 @@ /// ``` /// let x = &12; /// let addr_x = &x as *const _ as usize; - /// let addr_y = &&*x as *const _ as usize; // assert ok now, and lint triggerd. + /// let addr_y = &&*x as *const _ as usize; // assert ok now, and lint triggered. /// // But if we fix it, assert will fail. /// assert_ne!(addr_x, addr_y); /// ``` /// /// ### Example /// ```rust - /// fn foo(_x: &str) {} - /// /// let s = &String::new(); /// /// let a: &String = &* s; - /// foo(&*s); /// ``` /// /// Use instead: /// ```rust - /// # fn foo(_x: &str) {} /// # let s = &String::new(); /// let a: &String = s; - /// foo(&**s); /// ``` - #[clippy::version = "1.59.0"] + #[clippy::version = "1.63.0"] pub BORROW_DEREF_REF, complexity, "deref on an immutable reference returns the same type as itself"