about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/entry_unfixable.stderr
blob: f92f472512f6776a9364ee6188e4c1650b77993d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
error: usage of `contains_key` followed by `insert` on a `HashMap`
  --> tests/ui/entry_unfixable.rs:27:13
   |
LL | /             if !self.values.contains_key(&name) {
LL | |
LL | |                 self.values.insert(name, value);
LL | |                 true
...  |
LL | |                 false
LL | |             }
   | |_____________^
   |
   = help: consider using the `Entry` API: https://doc.rust-lang.org/std/collections/struct.HashMap.html#entry-api
   = note: `-D clippy::map-entry` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::map_entry)]`

error: usage of `contains_key` followed by `insert` on a `HashMap`
  --> tests/ui/entry_unfixable.rs:42:5
   |
LL | /     if hm.contains_key(&key) {
LL | |
LL | |         let bval = hm.get_mut(&key).unwrap();
LL | |         *bval = false;
LL | |     } else {
LL | |         hm.insert(key, true);
LL | |     }
   | |_____^
   |
   = help: consider using the `Entry` API: https://doc.rust-lang.org/std/collections/struct.HashMap.html#entry-api

error: usage of `contains_key` followed by `insert` on a `HashMap`
  --> tests/ui/entry_unfixable.rs:80:13
   |
LL | /             if self.globals.contains_key(&name) {
LL | |
LL | |                 self.globals.insert(name, value);
LL | |             } else {
LL | |                 let interner = INTERNER.lock().unwrap();
LL | |                 return Err(interner.resolve(name).unwrap().to_owned());
LL | |             }
   | |_____________^
   |
   = help: consider using the `Entry` API: https://doc.rust-lang.org/std/collections/struct.HashMap.html#entry-api

error: aborting due to 3 previous errors