]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/unused_lt.rs
Auto merge of #3603 - xfix:random-state-lint, r=phansch
[rust.git] / tests / ui / unused_lt.rs
index de13864421e1ed5e94526da887f45a9ffa65c3cc..99e80103f1f0db798b3d1e07dfb3ec6ed6e8f358 100644 (file)
@@ -7,25 +7,20 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-
-
-#![allow(unused, dead_code, clippy::needless_lifetimes, clippy::needless_pass_by_value, clippy::trivially_copy_pass_by_ref)]
+#![allow(
+    unused,
+    dead_code,
+    clippy::needless_lifetimes,
+    clippy::needless_pass_by_value,
+    clippy::trivially_copy_pass_by_ref
+)]
 #![warn(clippy::extra_unused_lifetimes)]
 
-fn empty() {
-
-}
-
-
-fn used_lt<'a>(x: &'a u8) {
-
-}
-
+fn empty() {}
 
-fn unused_lt<'a>(x: u8) {
+fn used_lt<'a>(x: &'a u8) {}
 
-}
+fn unused_lt<'a>(x: u8) {}
 
 fn unused_lt_transitive<'a, 'b: 'a>(x: &'b u8) {
     // 'a is useless here since it's not directly bound
@@ -39,19 +34,14 @@ fn lt_return_only<'a>() -> &'a u8 {
     panic!()
 }
 
-fn unused_lt_blergh<'a>(x: Option<Box<Send+'a>>) {
-
-}
-
+fn unused_lt_blergh<'a>(x: Option<Box<Send + 'a>>) {}
 
 trait Foo<'a> {
     fn x(&self, a: &'a u8);
 }
 
 impl<'a> Foo<'a> for u8 {
-    fn x(&self, a: &'a u8) {
-
-    }
+    fn x(&self, a: &'a u8) {}
 }
 
 struct Bar;
@@ -61,20 +51,23 @@ fn x<'a>(&self) {}
 }
 
 // test for #489 (used lifetimes in bounds)
-pub fn parse<'a, I: Iterator<Item=&'a str>>(_it: &mut I) {
+pub fn parse<'a, I: Iterator<Item = &'a str>>(_it: &mut I) {
     unimplemented!()
 }
-pub fn parse2<'a, I>(_it: &mut I) where I: Iterator<Item=&'a str>{
+pub fn parse2<'a, I>(_it: &mut I)
+where
+    I: Iterator<Item = &'a str>,
+{
     unimplemented!()
 }
 
-struct X { x: u32 }
+struct X {
+    x: u32,
+}
 
 impl X {
     fn self_ref_with_lifetime<'a>(&'a self) {}
     fn explicit_self_with_lifetime<'a>(self: &'a Self) {}
 }
 
-fn main() {
-
-}
+fn main() {}