]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/mut_key.rs
iterate List by value
[rust.git] / tests / ui / mut_key.rs
index 5ec9b05f5179b88985af11fa3622e17303d528b4..2d227e6654c36c0f45e6801205dd173f271d546a 100644 (file)
@@ -29,9 +29,27 @@ fn should_not_take_this_arg(m: &mut HashMap<Key, usize>, _n: usize) -> HashSet<K
     m.keys().cloned().collect()
 }
 
-fn this_is_ok(m: &mut HashMap<usize, Key>) {}
+fn this_is_ok(_m: &mut HashMap<usize, Key>) {}
+
+#[allow(unused)]
+trait Trait {
+    type AssociatedType;
+
+    fn trait_fn(&self, set: std::collections::HashSet<Self::AssociatedType>);
+}
+
+fn generics_are_ok_too<K>(_m: &mut HashSet<K>) {
+    // nothing to see here, move along
+}
+
+fn tuples<U>(_m: &mut HashMap<((), U), ()>) {}
+
+fn tuples_bad<U>(_m: &mut HashMap<(Key, U), bool>) {}
 
 fn main() {
     let _ = should_not_take_this_arg(&mut HashMap::new(), 1);
     this_is_ok(&mut HashMap::new());
+    tuples::<Key>(&mut HashMap::new());
+    tuples::<()>(&mut HashMap::new());
+    tuples_bad::<()>(&mut HashMap::new());
 }