]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/tests/ui/unit_arg.rs
Auto merge of #76378 - petrochenkov:lldtest, r=Mark-Simulacrum
[rust.git] / src / tools / clippy / tests / ui / unit_arg.rs
index d90c49f79de623de06b623664d540e3f2498d4d0..2992abae775b8ffb438f5ae4e645899698a1302e 100644 (file)
@@ -1,6 +1,5 @@
-// run-rustfix
 #![warn(clippy::unit_arg)]
-#![allow(unused_braces, clippy::no_effect, unused_must_use)]
+#![allow(clippy::no_effect, unused_must_use, unused_variables)]
 
 use std::fmt::Debug;
 
@@ -21,7 +20,6 @@ fn bar<T: Debug>(&self, t: T) {
 }
 
 fn bad() {
-    foo({});
     foo({
         1;
     });
@@ -30,11 +28,25 @@ fn bad() {
         foo(1);
         foo(2);
     });
-    foo3({}, 2, 2);
     let b = Bar;
     b.bar({
         1;
     });
+    taking_multiple_units(foo(0), foo(1));
+    taking_multiple_units(foo(0), {
+        foo(1);
+        foo(2);
+    });
+    taking_multiple_units(
+        {
+            foo(0);
+            foo(1);
+        },
+        {
+            foo(2);
+            foo(3);
+        },
+    );
 }
 
 fn ok() {
@@ -65,6 +77,13 @@ fn fallible() -> Result<(), i32> {
     }
 }
 
+#[allow(dead_code)]
+fn returning_expr() -> Option<()> {
+    Some(foo(1))
+}
+
+fn taking_multiple_units(a: (), b: ()) {}
+
 fn main() {
     bad();
     ok();