]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/tests/ui/trivially_copy_pass_by_ref.rs
Merge branch 'master' into hooks
[rust.git] / src / tools / clippy / tests / ui / trivially_copy_pass_by_ref.rs
index 316426f1cf181788dbc48dba7e69f244f4908531..e7e0a31febc45919ca44408c7772a83cc162126c 100644 (file)
@@ -97,6 +97,24 @@ fn a(b: &u16) {}
     pub fn c(d: &u16) {}
 }
 
+mod issue5876 {
+    // Don't lint here as it is always inlined
+    #[inline(always)]
+    fn foo_always(x: &i32) {
+        println!("{}", x);
+    }
+
+    #[inline(never)]
+    fn foo_never(x: &i32) {
+        println!("{}", x);
+    }
+
+    #[inline]
+    fn foo(x: &i32) {
+        println!("{}", x);
+    }
+}
+
 fn main() {
     let (mut foo, bar) = (Foo(0), Bar([0; 24]));
     let (mut a, b, c, x, y, z) = (0, 0, Bar([0; 24]), 0, Foo(0), 0);