Commit ea5bdff
committed
fix(arena): resolve clippy warnings for unsized types in Collect trait
Split static_collect! macro into two variants to handle sized vs unsized types:
- static_collect_sized! for types that implement Sized (implements needs_trace)
- static_collect! for potentially unsized types (skips needs_trace)
This fixes clippy warnings about needs_trace() not being usable for unsized
types like str, CStr, Path, and OsStr due to the Sized bound in the trait.
Also removed needs_trace() implementations from:
- &'static T (where T: ?Sized)
- [T] (slice type is inherently unsized)
The trait's default implementation handles the optimization check for sized
types, while unsized types simply don't provide the method.1 parent f20e08f commit ea5bdff
File tree
2 files changed
+36
-31
lines changed- aiscript-arena/src
- aiscript-vm/src/compiler
2 files changed
+36
-31
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
19 | 32 | | |
20 | 33 | | |
21 | 34 | | |
| |||
29 | 42 | | |
30 | 43 | | |
31 | 44 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
47 | 60 | | |
48 | | - | |
| 61 | + | |
49 | 62 | | |
50 | | - | |
| 63 | + | |
51 | 64 | | |
52 | 65 | | |
53 | 66 | | |
54 | | - | |
| 67 | + | |
55 | 68 | | |
56 | 69 | | |
57 | 70 | | |
58 | | - | |
| 71 | + | |
59 | 72 | | |
60 | 73 | | |
61 | 74 | | |
| |||
84 | 97 | | |
85 | 98 | | |
86 | 99 | | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
| 100 | + | |
91 | 101 | | |
92 | 102 | | |
93 | 103 | | |
| |||
98 | 108 | | |
99 | 109 | | |
100 | 110 | | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
| 111 | + | |
105 | 112 | | |
106 | 113 | | |
107 | 114 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
111 | | - | |
112 | | - | |
| 110 | + | |
113 | 111 | | |
114 | 112 | | |
115 | 113 | | |
| |||
0 commit comments