Commit d029ebf
committed
auto merge of #7902 : huonw/rust/attr++, r=cmr,pcwalton
This does a number of things, but especially dramatically reduce the
number of allocations performed for operations involving attributes/
meta items:
- Converts ast::meta_item & ast::attribute and other associated enums
to CamelCase.
- Converts several standalone functions in syntax::attr into methods,
defined on two traits AttrMetaMethods & AttributeMethods. The former
is common to both MetaItem and Attribute since the latter is a thin
wrapper around the former.
- Deletes functions that are unnecessary due to iterators.
- Converts other standalone functions to use iterators and the generic
AttrMetaMethods rather than allocating a lot of new vectors (e.g. the
old code would have to allocate a new vector to use functions that
operated on &[meta_item] on &[attribute].)
- Moves the core algorithm of the #[cfg] matching to syntax::attr,
similar to find_inline_attr and find_linkage_metas.
This doesn't have much of an effect on the speed of #[cfg] stripping,
despite hugely reducing the number of allocations performed; presumably
most of the time is spent in the ast folder rather than doing attribute
checks.
Also fixes the Eq instance of MetaItem_ to correctly ignore spans, so
that `rustc --cfg 'foo(bar)'` now works.File tree
60 files changed
+728
-811
lines changed- src
- librustc
- back
- driver
- front
- metadata
- middle
- trans
- librustdoc
- librustpkg
- libsyntax
- ext
- deriving
- cmp
- parse
- print
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
60 files changed
+728
-811
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
502 | 503 | | |
503 | 504 | | |
504 | 505 | | |
505 | | - | |
| 506 | + | |
506 | 507 | | |
507 | 508 | | |
508 | 509 | | |
| |||
513 | 514 | | |
514 | 515 | | |
515 | 516 | | |
516 | | - | |
517 | | - | |
518 | | - | |
519 | | - | |
520 | | - | |
521 | | - | |
522 | | - | |
523 | | - | |
524 | | - | |
525 | | - | |
526 | | - | |
527 | | - | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
528 | 521 | | |
529 | 522 | | |
530 | 523 | | |
| |||
537 | 530 | | |
538 | 531 | | |
539 | 532 | | |
540 | | - | |
| 533 | + | |
541 | 534 | | |
542 | 535 | | |
543 | 536 | | |
| |||
549 | 542 | | |
550 | 543 | | |
551 | 544 | | |
552 | | - | |
| 545 | + | |
553 | 546 | | |
554 | | - | |
| 547 | + | |
555 | 548 | | |
556 | 549 | | |
557 | 550 | | |
558 | | - | |
| 551 | + | |
559 | 552 | | |
560 | 553 | | |
561 | | - | |
| 554 | + | |
562 | 555 | | |
563 | 556 | | |
564 | 557 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
104 | 102 | | |
105 | 103 | | |
106 | 104 | | |
| |||
109 | 107 | | |
110 | 108 | | |
111 | 109 | | |
112 | | - | |
| 110 | + | |
113 | 111 | | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
| 112 | + | |
120 | 113 | | |
121 | | - | |
122 | | - | |
123 | | - | |
| 114 | + | |
124 | 115 | | |
125 | 116 | | |
126 | 117 | | |
| |||
130 | 121 | | |
131 | 122 | | |
132 | 123 | | |
133 | | - | |
| 124 | + | |
134 | 125 | | |
135 | 126 | | |
136 | 127 | | |
| |||
215 | 206 | | |
216 | 207 | | |
217 | 208 | | |
| 209 | + | |
218 | 210 | | |
219 | 211 | | |
220 | 212 | | |
| |||
870 | 862 | | |
871 | 863 | | |
872 | 864 | | |
873 | | - | |
| 865 | + | |
874 | 866 | | |
875 | 867 | | |
876 | 868 | | |
| |||
912 | 904 | | |
913 | 905 | | |
914 | 906 | | |
915 | | - | |
916 | | - | |
917 | | - | |
918 | | - | |
919 | | - | |
920 | | - | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
921 | 911 | | |
922 | 912 | | |
923 | 913 | | |
| |||
1011 | 1001 | | |
1012 | 1002 | | |
1013 | 1003 | | |
1014 | | - | |
1015 | | - | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
1016 | 1007 | | |
1017 | 1008 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
369 | 369 | | |
370 | 370 | | |
371 | 371 | | |
372 | | - | |
| 372 | + | |
373 | 373 | | |
374 | 374 | | |
375 | 375 | | |
| |||
395 | 395 | | |
396 | 396 | | |
397 | 397 | | |
| 398 | + | |
398 | 399 | | |
399 | 400 | | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | | - | |
409 | | - | |
| 401 | + | |
| 402 | + | |
410 | 403 | | |
411 | 404 | | |
412 | 405 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
| 178 | + | |
| 179 | + | |
205 | 180 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | | - | |
36 | | - | |
| 35 | + | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
| 51 | + | |
| 52 | + | |
59 | 53 | | |
60 | 54 | | |
61 | 55 | | |
| |||
0 commit comments