]> git.lizzy.rs Git - rust.git/blob - tests/ui/entry_unfixable.stderr
Split map_entry tests into fixable and unfixable
[rust.git] / tests / ui / entry_unfixable.stderr
1 error: usage of `contains_key` followed by `insert` on a `HashMap`
2   --> $DIR/entry_unfixable.rs:10:5
3    |
4 LL | /     if !m.contains_key(&k) {
5 LL | |         m.insert(k, v)
6 LL | |     } else {
7 LL | |         None
8 LL | |     };
9    | |_____^
10    |
11    = note: `-D clippy::map-entry` implied by `-D warnings`
12 help: consider using `m.entry(k)`
13   --> $DIR/entry_unfixable.rs:10:5
14    |
15 LL | /     if !m.contains_key(&k) {
16 LL | |         m.insert(k, v)
17 LL | |     } else {
18 LL | |         None
19 LL | |     };
20    | |_____^
21
22 error: usage of `contains_key` followed by `insert` on a `HashMap`
23   --> $DIR/entry_unfixable.rs:18:5
24    |
25 LL | /     if m.contains_key(&k) {
26 LL | |         None
27 LL | |     } else {
28 LL | |         m.insert(k, v)
29 LL | |     };
30    | |_____^
31    |
32 help: consider using `m.entry(k)`
33   --> $DIR/entry_unfixable.rs:18:5
34    |
35 LL | /     if m.contains_key(&k) {
36 LL | |         None
37 LL | |     } else {
38 LL | |         m.insert(k, v)
39 LL | |     };
40    | |_____^
41
42 error: usage of `contains_key` followed by `insert` on a `HashMap`
43   --> $DIR/entry_unfixable.rs:26:5
44    |
45 LL | /     if !m.contains_key(&k) {
46 LL | |         foo();
47 LL | |         m.insert(k, v)
48 LL | |     } else {
49 LL | |         None
50 LL | |     };
51    | |_____^
52    |
53 help: consider using `m.entry(k)`
54   --> $DIR/entry_unfixable.rs:26:5
55    |
56 LL | /     if !m.contains_key(&k) {
57 LL | |         foo();
58 LL | |         m.insert(k, v)
59 LL | |     } else {
60 LL | |         None
61 LL | |     };
62    | |_____^
63
64 error: usage of `contains_key` followed by `insert` on a `HashMap`
65   --> $DIR/entry_unfixable.rs:35:5
66    |
67 LL | /     if m.contains_key(&k) {
68 LL | |         None
69 LL | |     } else {
70 LL | |         foo();
71 LL | |         m.insert(k, v)
72 LL | |     };
73    | |_____^
74    |
75 help: consider using `m.entry(k)`
76   --> $DIR/entry_unfixable.rs:35:5
77    |
78 LL | /     if m.contains_key(&k) {
79 LL | |         None
80 LL | |     } else {
81 LL | |         foo();
82 LL | |         m.insert(k, v)
83 LL | |     };
84    | |_____^
85
86 error: usage of `contains_key` followed by `insert` on a `BTreeMap`
87   --> $DIR/entry_unfixable.rs:44:5
88    |
89 LL | /     if !m.contains_key(&k) {
90 LL | |         foo();
91 LL | |         m.insert(k, v)
92 LL | |     } else {
93 LL | |         None
94 LL | |     };
95    | |_____^
96    |
97 help: consider using `m.entry(k)`
98   --> $DIR/entry_unfixable.rs:44:5
99    |
100 LL | /     if !m.contains_key(&k) {
101 LL | |         foo();
102 LL | |         m.insert(k, v)
103 LL | |     } else {
104 LL | |         None
105 LL | |     };
106    | |_____^
107
108 error: aborting due to 5 previous errors
109