diff --git a/tests/ui/entry.rs b/tests/ui/entry.rs index eebf2518a65c..0c84cd325c4d 100644 --- a/tests/ui/entry.rs +++ b/tests/ui/entry.rs @@ -69,7 +69,14 @@ fn insert_other_if_absent(m: &mut HashMap, k: K, o: K, v: } // should not trigger, because the one uses different HashMap from another one -fn insert_other(m: &mut HashMap, n: &mut HashMap, k: K, v: V) { +fn insert_from_different_map(m: HashMap, n: &mut HashMap, k: K, v: V) { + if !m.contains_key(&k) { + n.insert(k, v); + } +} + +// should not trigger, because the one uses different HashMap from another one +fn insert_from_different_map2(m: &mut HashMap, n: &mut HashMap, k: K, v: V) { if !m.contains_key(&k) { n.insert(k, v); }