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