@@ -83,21 +83,11 @@ macro_rules! with_bounds {
83
83
}
84
84
}
85
85
86
- macro_rules! with_heap_size_bound {
87
- ( $( $HeapSizeOf: tt ) * ) => {
88
- with_bounds! {
89
- [ Clone + Eq + Hash $( $HeapSizeOf) * ]
90
- [ From <String > + for <' a> From <& ' a str >]
91
- }
92
- }
86
+ with_bounds ! {
87
+ [ Clone + Eq + Hash ]
88
+ [ From <String > + for <' a> From <& ' a str >]
93
89
}
94
90
95
- #[ cfg( feature = "heap_size" ) ]
96
- with_heap_size_bound ! ( + :: heapsize:: HeapSizeOf ) ;
97
-
98
- #[ cfg( not( feature = "heap_size" ) ) ]
99
- with_heap_size_bound ! ( ) ;
100
-
101
91
pub trait Parser {
102
92
type Impl : SelectorImpl ;
103
93
@@ -130,7 +120,6 @@ pub trait Parser {
130
120
}
131
121
}
132
122
133
- #[ cfg_attr( feature = "heap_size" , derive( HeapSizeOf ) ) ]
134
123
#[ derive( PartialEq , Clone , Debug ) ]
135
124
pub struct SelectorList < Impl : SelectorImpl > ( pub Vec < Selector < Impl > > ) ;
136
125
@@ -146,7 +135,6 @@ impl<Impl: SelectorImpl> SelectorList<Impl> {
146
135
}
147
136
}
148
137
149
- #[ cfg_attr( feature = "heap_size" , derive( HeapSizeOf ) ) ]
150
138
#[ derive( PartialEq , Clone ) ]
151
139
pub struct Selector < Impl : SelectorImpl > {
152
140
pub complex_selector : Arc < ComplexSelector < Impl > > ,
@@ -234,14 +222,12 @@ impl<Impl: SelectorImpl> ComplexSelector<Impl> {
234
222
}
235
223
}
236
224
237
- #[ cfg_attr( feature = "heap_size" , derive( HeapSizeOf ) ) ]
238
225
#[ derive( Clone , Eq , Hash , PartialEq ) ]
239
226
pub struct ComplexSelector < Impl : SelectorImpl > {
240
227
pub compound_selector : Vec < SimpleSelector < Impl > > ,
241
228
pub next : Option < ( Arc < ComplexSelector < Impl > > , Combinator ) > , // c.next is left of c
242
229
}
243
230
244
- #[ cfg_attr( feature = "heap_size" , derive( HeapSizeOf ) ) ]
245
231
#[ derive( Eq , PartialEq , Clone , Copy , Debug , Hash ) ]
246
232
pub enum Combinator {
247
233
Child , // >
@@ -250,7 +236,6 @@ pub enum Combinator {
250
236
LaterSibling , // ~
251
237
}
252
238
253
- #[ cfg_attr( feature = "heap_size" , derive( HeapSizeOf ) ) ]
254
239
#[ derive( Eq , PartialEq , Clone , Hash ) ]
255
240
pub enum SimpleSelector < Impl : SelectorImpl > {
256
241
ID ( Impl :: Identifier ) ,
@@ -289,38 +274,33 @@ pub enum SimpleSelector<Impl: SelectorImpl> {
289
274
}
290
275
291
276
#[ derive( Eq , PartialEq , Clone , Hash , Copy , Debug ) ]
292
- #[ cfg_attr( feature = "heap_size" , derive( HeapSizeOf ) ) ]
293
277
pub enum CaseSensitivity {
294
278
CaseSensitive , // Selectors spec says language-defined, but HTML says sensitive.
295
279
CaseInsensitive ,
296
280
}
297
281
298
282
299
283
#[ derive( Eq , PartialEq , Clone , Hash ) ]
300
- #[ cfg_attr( feature = "heap_size" , derive( HeapSizeOf ) ) ]
301
284
pub struct LocalName < Impl : SelectorImpl > {
302
285
pub name : Impl :: LocalName ,
303
286
pub lower_name : Impl :: LocalName ,
304
287
}
305
288
306
289
#[ derive( Eq , PartialEq , Clone , Hash ) ]
307
- #[ cfg_attr( feature = "heap_size" , derive( HeapSizeOf ) ) ]
308
290
pub struct AttrSelector < Impl : SelectorImpl > {
309
291
pub name : Impl :: LocalName ,
310
292
pub lower_name : Impl :: LocalName ,
311
293
pub namespace : NamespaceConstraint < Impl > ,
312
294
}
313
295
314
296
#[ derive( Eq , PartialEq , Clone , Hash , Debug ) ]
315
- #[ cfg_attr( feature = "heap_size" , derive( HeapSizeOf ) ) ]
316
297
pub enum NamespaceConstraint < Impl : SelectorImpl > {
317
298
Any ,
318
299
Specific ( Namespace < Impl > ) ,
319
300
}
320
301
321
302
/// FIXME(SimonSapin): should Hash only hash the URL? What is it used for?
322
303
#[ derive( Eq , PartialEq , Clone , Hash ) ]
323
- #[ cfg_attr( feature = "heap_size" , derive( HeapSizeOf ) ) ]
324
304
pub struct Namespace < Impl : SelectorImpl > {
325
305
pub prefix : Option < Impl :: NamespacePrefix > ,
326
306
pub url : Impl :: NamespaceUrl ,
0 commit comments