]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/deref_addrof.fixed
Rollup merge of #92849 - flip1995:clippyup, r=Manishearth
[rust.git] / tests / ui / deref_addrof.fixed
index d4832daa6895970746de537909bb6339af07331e..2f489deb1ee1f5910b3acd8038c5de8ac531c877 100644 (file)
@@ -1,4 +1,5 @@
 // run-rustfix
+#![allow(clippy::return_self_not_must_use)]
 #![warn(clippy::deref_addrof)]
 
 fn get_number() -> usize {
@@ -36,6 +37,8 @@ fn main() {
     let b = &a;
 
     let b = *aref;
+
+    let _ = unsafe { *core::ptr::addr_of!(a) };
 }
 
 #[rustfmt::skip]
@@ -52,12 +55,14 @@ macro_rules! m_mut {
     };
 }
 
+#[derive(Copy, Clone)]
 pub struct S;
 impl S {
     pub fn f(&self) -> &Self {
         m!(self)
     }
-    pub fn f_mut(&self) -> &Self {
+    #[allow(unused_mut)] // mut will be unused, once the macro is fixed
+    pub fn f_mut(mut self) -> Self {
         m_mut!(self)
     }
 }