Commit a129548
committed
Unify macro name detection for cfg_{if|matach}!
Specifically, both cfg_if! and cfg_match! visitors now gate using the
same is_macro_name predicate, which checks the last path segment ident.
cfg_if! previously tested the *first* path segment, meaning that the
visitor would walk `cfg_if!` and `cfg_if::cfg_if!`, but would also
walk `cfg_if::other!` and wouldn't walk `::cfg_if::cfg_if!`. cfg_match!
instead chose to check the *last* path segment, so its visitor would
walk any macro invoked as `cfg_match!` independent of the leading path.1 parent 924b834 commit a129548
2 files changed
+17
-58
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
590 | 590 | | |
591 | 591 | | |
592 | 592 | | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
593 | 600 | | |
594 | 601 | | |
595 | | - | |
596 | | - | |
597 | | - | |
598 | | - | |
599 | | - | |
600 | | - | |
601 | | - | |
602 | | - | |
| 602 | + | |
603 | 603 | | |
604 | 604 | | |
605 | 605 | | |
606 | 606 | | |
607 | 607 | | |
608 | 608 | | |
609 | | - | |
610 | | - | |
611 | | - | |
612 | | - | |
613 | | - | |
614 | | - | |
615 | | - | |
616 | | - | |
| 609 | + | |
617 | 610 | | |
618 | 611 | | |
619 | 612 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
66 | 49 | | |
67 | 50 | | |
68 | 51 | | |
| |||
102 | 85 | | |
103 | 86 | | |
104 | 87 | | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
125 | 91 | | |
126 | 92 | | |
127 | 93 | | |
| |||
0 commit comments