Commit b3b97f5
rust: macros: support
Currently, we generate `HAS_` constants as long as the definition exists in
the source, regardless if it is cfg-ed out or not.
Currently, uses of `#[cfg]` present in both trait and impl, so it is not a
problem; however if only the impl side uses `#[cfg]` then `HAS_` constants
will incorrectly be true while it shouldnt't.
With `syn` support, we can now implement `#[cfg]` handling properly by
propagating the `#[cfg]` attributes to the constants.
Signed-off-by: Gary Guo <[email protected]>#[cfg] properly in #[vtable] macro.1 parent e0d04a6 commit b3b97f5
2 files changed
+13
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
| |||
38 | 37 | | |
39 | 38 | | |
40 | 39 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | 40 | | |
48 | 41 | | |
49 | 42 | | |
| 43 | + | |
50 | 44 | | |
51 | 45 | | |
52 | 46 | | |
| 47 | + | |
53 | 48 | | |
54 | 49 | | |
55 | 50 | | |
56 | | - | |
57 | 51 | | |
58 | 52 | | |
59 | 53 | | |
| |||
87 | 81 | | |
88 | 82 | | |
89 | 83 | | |
| 84 | + | |
90 | 85 | | |
| 86 | + | |
91 | 87 | | |
92 | 88 | | |
93 | | - | |
94 | 89 | | |
95 | 90 | | |
96 | 91 | | |
| |||
0 commit comments