]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/unused_unit.fixed
Move MSRV tests into the lint specific test files
[rust.git] / tests / ui / unused_unit.fixed
index 07f2791786d7f48711378386377019c698b33af4..7bb43cf7ae82ded49dc035f3e03f798993547cc6 100644 (file)
 
 #![deny(clippy::unused_unit)]
 #![allow(dead_code)]
+#![allow(clippy::from_over_into)]
 
 struct Unitter;
 impl Unitter {
     #[allow(clippy::no_effect)]
-    pub fn get_unit<F: Fn() , G>(&self, f: F, _g: G) 
-    where G: Fn()  {
-        let _y: &dyn Fn()  = &f;
+    pub fn get_unit<F: Fn(), G>(&self, f: F, _g: G)
+    where G: Fn() {
+        let _y: &dyn Fn() = &f;
         (); // this should not lint, as it's not in return type position
     }
 }
 
 impl Into<()> for Unitter {
     #[rustfmt::skip]
-    fn into(self)  {
+    fn into(self) {
         
     }
 }
 
 trait Trait {
-    fn redundant<F: FnOnce() , G, H>(&self, _f: F, _g: G, _h: H)
+    fn redundant<F: FnOnce(), G, H>(&self, _f: F, _g: G, _h: H)
     where
-        G: FnMut() ,
-        H: Fn() ;
+        G: FnMut(),
+        H: Fn();
 }
 
 impl Trait for Unitter {
-    fn redundant<F: FnOnce() , G, H>(&self, _f: F, _g: G, _h: H)
+    fn redundant<F: FnOnce(), G, H>(&self, _f: F, _g: G, _h: H)
     where
-        G: FnMut() ,
-        H: Fn()  {}
+        G: FnMut(),
+        H: Fn() {}
 }
 
-fn return_unit()  {  }
+fn return_unit() {  }
 
 #[allow(clippy::needless_return)]
 #[allow(clippy::never_loop)]
@@ -70,3 +71,19 @@ fn foo() {
         recv(rx) -> _x => ()
     }
 }
+
+#[rustfmt::skip]
+fn test(){}
+
+#[rustfmt::skip]
+fn test2(){}
+
+#[rustfmt::skip]
+fn test3(){}
+
+fn macro_expr() {
+    macro_rules! e {
+        () => (());
+    }
+    e!()
+}