Commit deed0f2
committed
Remove useless
`FmtVisitor::visit_mac` has an `Option<Ident>` arg which is always
either `None` or `Some(kw::Empty)`, because `ItemKind::MacCall` always
has an empty ident. This value is passed through various functions until
it reaches `rewrite_macro_name`, which treats `None` and
`Some(kw::Empty)` the same.
In other words, the argument is useless. This commit removes it. There
is no change in behaviour. The commit also changes a few `symbol::Ident`
occurrences to `Ident` in `macros.rs`; `Symbol` is imported in that file
so `Ident` might as well be, too.
(This is a good example of why it's a bad idea for `Itemt` to have an
`ident` field when various item kinds don't have an identifier. It's
easy to get confused when "empty identifier" is used to mean "no
identifier". This will be fixed in a subsequent commit.)Option<Ident> arg.1 parent 4c551bc commit deed0f2
File tree
6 files changed
+16
-38
lines changed- src/tools/rustfmt/src
6 files changed
+16
-38
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
249 | | - | |
| 249 | + | |
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3508 | 3508 | | |
3509 | 3509 | | |
3510 | 3510 | | |
3511 | | - | |
| 3511 | + | |
3512 | 3512 | | |
3513 | 3513 | | |
3514 | 3514 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
| 19 | + | |
23 | 20 | | |
24 | 21 | | |
25 | 22 | | |
| |||
60 | 57 | | |
61 | 58 | | |
62 | 59 | | |
63 | | - | |
| 60 | + | |
64 | 61 | | |
65 | 62 | | |
66 | 63 | | |
| |||
103 | 100 | | |
104 | 101 | | |
105 | 102 | | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
| 103 | + | |
| 104 | + | |
112 | 105 | | |
113 | 106 | | |
114 | 107 | | |
115 | 108 | | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | 109 | | |
121 | 110 | | |
122 | 111 | | |
| |||
165 | 154 | | |
166 | 155 | | |
167 | 156 | | |
168 | | - | |
169 | 157 | | |
170 | 158 | | |
171 | 159 | | |
| |||
179 | 167 | | |
180 | 168 | | |
181 | 169 | | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
| 170 | + | |
190 | 171 | | |
191 | 172 | | |
192 | 173 | | |
| |||
207 | 188 | | |
208 | 189 | | |
209 | 190 | | |
210 | | - | |
211 | 191 | | |
212 | 192 | | |
213 | 193 | | |
| |||
222 | 202 | | |
223 | 203 | | |
224 | 204 | | |
225 | | - | |
| 205 | + | |
226 | 206 | | |
227 | 207 | | |
228 | 208 | | |
| |||
432 | 412 | | |
433 | 413 | | |
434 | 414 | | |
435 | | - | |
| 415 | + | |
436 | 416 | | |
437 | 417 | | |
438 | 418 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
307 | 307 | | |
308 | 308 | | |
309 | 309 | | |
310 | | - | |
311 | | - | |
312 | | - | |
| 310 | + | |
313 | 311 | | |
314 | 312 | | |
315 | 313 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1018 | 1018 | | |
1019 | 1019 | | |
1020 | 1020 | | |
1021 | | - | |
| 1021 | + | |
1022 | 1022 | | |
1023 | 1023 | | |
1024 | 1024 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
175 | | - | |
| 175 | + | |
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
| |||
531 | 531 | | |
532 | 532 | | |
533 | 533 | | |
534 | | - | |
| 534 | + | |
535 | 535 | | |
536 | 536 | | |
537 | 537 | | |
| |||
678 | 678 | | |
679 | 679 | | |
680 | 680 | | |
681 | | - | |
| 681 | + | |
682 | 682 | | |
683 | 683 | | |
684 | 684 | | |
| |||
692 | 692 | | |
693 | 693 | | |
694 | 694 | | |
695 | | - | |
| 695 | + | |
696 | 696 | | |
697 | 697 | | |
698 | 698 | | |
699 | 699 | | |
700 | | - | |
| 700 | + | |
701 | 701 | | |
702 | 702 | | |
703 | 703 | | |
| |||
0 commit comments