]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/implicit_hasher.rs
Auto merge of #3603 - xfix:random-state-lint, r=phansch
[rust.git] / tests / ui / implicit_hasher.rs
index a6be909c0cc20c314c0f8fc590bfcfd875a00f1d..acd5a52ff386f65934f3ba0da46ee3c63d6e0049 100644 (file)
@@ -7,12 +7,11 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
 #![allow(unused)]
 
-use std::collections::{HashMap, HashSet};
 use std::cmp::Eq;
-use std::hash::{Hash, BuildHasher};
+use std::collections::{HashMap, HashSet};
+use std::hash::{BuildHasher, Hash};
 
 pub trait Foo<T>: Sized {
     fn make() -> (Self, Self);
@@ -49,7 +48,6 @@ fn make() -> (Self, Self) {
     }
 }
 
-
 impl<T: Hash + Eq> Foo<i8> for HashSet<T> {
     fn make() -> (Self, Self) {
         (HashSet::new(), HashSet::with_capacity(10))
@@ -72,8 +70,7 @@ fn make() -> (Self, Self) {
     }
 }
 
-pub fn foo(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32>) {
-}
+pub fn foo(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32>) {}
 
 macro_rules! gen {
     (impl) => {
@@ -85,11 +82,10 @@ fn make() -> (Self, Self) {
     };
 
     (fn $name:ident) => {
-        pub fn $name(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32>) {
-        }
-    }
+        pub fn $name(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32>) {}
+    };
 }
-
+#[rustfmt::skip]
 gen!(impl);
 gen!(fn bar);
 
@@ -97,7 +93,8 @@ pub fn $name(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32>) {
 // and should not cause an ICE
 // See #2707
 #[macro_use]
-#[path = "../auxiliary/test_macro.rs"] pub mod test_macro;
+#[path = "../auxiliary/test_macro.rs"]
+pub mod test_macro;
 __implicit_hasher_test_macro!(impl<K, V> for HashMap<K, V> where V: test_macro::A);
 
 fn main() {}