Skip to content
This repository was archived by the owner on May 28, 2024. It is now read-only.

Commit 7c2387c

Browse files
committed
Remove heapsize feature
It’s broken on current Rust versions (still uses the old compiler plugin) it nobody seems to use it since nobody noticed.
1 parent 4d7c5d8 commit 7c2387c

File tree

3 files changed

+3
-32
lines changed

3 files changed

+3
-32
lines changed

Cargo.toml

-5
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,8 @@ readme = "README.md"
1111
keywords = ["css", "selectors"]
1212
license = "MPL-2.0"
1313

14-
[features]
15-
heap_size = ["heapsize", "heapsize_plugin"]
16-
1714
[dependencies]
1815
bitflags = "0.7"
1916
matches = "0.1"
2017
cssparser = ">=0.6, <0.8"
2118
fnv = "1.0"
22-
heapsize = {version = "0.3", features = ["unstable"], optional = true}
23-
heapsize_plugin = {version = "0.1.0", optional = true}

src/lib.rs

-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

5-
#![cfg_attr(feature = "heap_size", feature(plugin, custom_derive))]
6-
#![cfg_attr(feature = "heap_size", plugin(heapsize_plugin))]
7-
8-
#[cfg(feature = "heap_size")] extern crate heapsize;
95
#[macro_use] extern crate bitflags;
106
#[macro_use] extern crate cssparser;
117
#[macro_use] extern crate matches;

src/parser.rs

+3-23
Original file line numberDiff line numberDiff line change
@@ -83,21 +83,11 @@ macro_rules! with_bounds {
8383
}
8484
}
8585

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>]
9389
}
9490

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-
10191
pub trait Parser {
10292
type Impl: SelectorImpl;
10393

@@ -130,7 +120,6 @@ pub trait Parser {
130120
}
131121
}
132122

133-
#[cfg_attr(feature = "heap_size", derive(HeapSizeOf))]
134123
#[derive(PartialEq, Clone, Debug)]
135124
pub struct SelectorList<Impl: SelectorImpl>(pub Vec<Selector<Impl>>);
136125

@@ -146,7 +135,6 @@ impl<Impl: SelectorImpl> SelectorList<Impl> {
146135
}
147136
}
148137

149-
#[cfg_attr(feature = "heap_size", derive(HeapSizeOf))]
150138
#[derive(PartialEq, Clone)]
151139
pub struct Selector<Impl: SelectorImpl> {
152140
pub complex_selector: Arc<ComplexSelector<Impl>>,
@@ -234,14 +222,12 @@ impl<Impl: SelectorImpl> ComplexSelector<Impl> {
234222
}
235223
}
236224

237-
#[cfg_attr(feature = "heap_size", derive(HeapSizeOf))]
238225
#[derive(Clone, Eq, Hash, PartialEq)]
239226
pub struct ComplexSelector<Impl: SelectorImpl> {
240227
pub compound_selector: Vec<SimpleSelector<Impl>>,
241228
pub next: Option<(Arc<ComplexSelector<Impl>>, Combinator)>, // c.next is left of c
242229
}
243230

244-
#[cfg_attr(feature = "heap_size", derive(HeapSizeOf))]
245231
#[derive(Eq, PartialEq, Clone, Copy, Debug, Hash)]
246232
pub enum Combinator {
247233
Child, // >
@@ -250,7 +236,6 @@ pub enum Combinator {
250236
LaterSibling, // ~
251237
}
252238

253-
#[cfg_attr(feature = "heap_size", derive(HeapSizeOf))]
254239
#[derive(Eq, PartialEq, Clone, Hash)]
255240
pub enum SimpleSelector<Impl: SelectorImpl> {
256241
ID(Impl::Identifier),
@@ -289,38 +274,33 @@ pub enum SimpleSelector<Impl: SelectorImpl> {
289274
}
290275

291276
#[derive(Eq, PartialEq, Clone, Hash, Copy, Debug)]
292-
#[cfg_attr(feature = "heap_size", derive(HeapSizeOf))]
293277
pub enum CaseSensitivity {
294278
CaseSensitive, // Selectors spec says language-defined, but HTML says sensitive.
295279
CaseInsensitive,
296280
}
297281

298282

299283
#[derive(Eq, PartialEq, Clone, Hash)]
300-
#[cfg_attr(feature = "heap_size", derive(HeapSizeOf))]
301284
pub struct LocalName<Impl: SelectorImpl> {
302285
pub name: Impl::LocalName,
303286
pub lower_name: Impl::LocalName,
304287
}
305288

306289
#[derive(Eq, PartialEq, Clone, Hash)]
307-
#[cfg_attr(feature = "heap_size", derive(HeapSizeOf))]
308290
pub struct AttrSelector<Impl: SelectorImpl> {
309291
pub name: Impl::LocalName,
310292
pub lower_name: Impl::LocalName,
311293
pub namespace: NamespaceConstraint<Impl>,
312294
}
313295

314296
#[derive(Eq, PartialEq, Clone, Hash, Debug)]
315-
#[cfg_attr(feature = "heap_size", derive(HeapSizeOf))]
316297
pub enum NamespaceConstraint<Impl: SelectorImpl> {
317298
Any,
318299
Specific(Namespace<Impl>),
319300
}
320301

321302
/// FIXME(SimonSapin): should Hash only hash the URL? What is it used for?
322303
#[derive(Eq, PartialEq, Clone, Hash)]
323-
#[cfg_attr(feature = "heap_size", derive(HeapSizeOf))]
324304
pub struct Namespace<Impl: SelectorImpl> {
325305
pub prefix: Option<Impl::NamespacePrefix>,
326306
pub url: Impl::NamespaceUrl,

0 commit comments

Comments
 (0)