@@ -245,13 +245,13 @@ macro_rules! with_bounds {
245245
246246#[ cfg( feature = "serde" ) ]
247247with_bounds ! {
248- [ Clone + PartialEq ]
248+ [ Clone + PartialEq + Eq + std :: hash :: Hash ]
249249 [ From <CowRcStr <' i>> + From <std:: borrow:: Cow <' i, str >> + AsRef <str >]
250250}
251251
252252#[ cfg( not( feature = "serde" ) ) ]
253253with_bounds ! {
254- [ Clone + PartialEq ]
254+ [ Clone + PartialEq + Eq + std :: hash :: Hash ]
255255 [ From <CowRcStr <' i>>]
256256}
257257
@@ -342,7 +342,7 @@ pub trait Parser<'i> {
342342 }
343343}
344344
345- #[ derive( Clone , Debug , PartialEq ) ]
345+ #[ derive( Clone , Debug , PartialEq , Eq , Hash ) ]
346346#[ cfg_attr(
347347 feature = "serde" ,
348348 derive( serde:: Serialize , serde:: Deserialize ) ,
@@ -676,7 +676,7 @@ pub fn namespace_empty_string<'i, Impl: SelectorImpl<'i>>() -> Impl::NamespaceUr
676676///
677677/// This reordering doesn't change the semantics of selector matching, and we
678678/// handle it in to_css to make it invisible to serialization.
679- #[ derive( Clone , PartialEq ) ]
679+ #[ derive( Clone , PartialEq , Eq , Hash ) ]
680680pub struct Selector < ' i , Impl : SelectorImpl < ' i > > ( SpecificityAndFlags , Vec < Component < ' i , Impl > > ) ;
681681
682682impl < ' i , Impl : SelectorImpl < ' i > > Selector < ' i , Impl > {
@@ -1093,7 +1093,7 @@ impl<'a, 'i, Impl: SelectorImpl<'i>> Iterator for AncestorIter<'a, 'i, Impl> {
10931093 }
10941094}
10951095
1096- #[ derive( Clone , Copy , Debug , Eq , PartialEq ) ]
1096+ #[ derive( Clone , Copy , Debug , Eq , PartialEq , Hash ) ]
10971097#[ cfg_attr(
10981098 feature = "serde" ,
10991099 derive( serde:: Serialize , serde:: Deserialize ) ,
@@ -1152,7 +1152,7 @@ impl Combinator {
11521152}
11531153
11541154/// An enum for the different types of :nth- pseudoclasses
1155- #[ derive( Copy , Clone , Eq , PartialEq ) ]
1155+ #[ derive( Copy , Clone , Eq , PartialEq , Hash ) ]
11561156pub enum NthType {
11571157 Child ,
11581158 LastChild ,
@@ -1185,7 +1185,7 @@ impl NthType {
11851185/// The properties that comprise an :nth- pseudoclass as of Selectors 3 (e.g.,
11861186/// nth-child(An+B)).
11871187/// https://www.w3.org/TR/selectors-3/#nth-child-pseudo
1188- #[ derive( Copy , Clone , Eq , PartialEq ) ]
1188+ #[ derive( Copy , Clone , Eq , PartialEq , Hash ) ]
11891189pub struct NthSelectorData {
11901190 pub ty : NthType ,
11911191 pub is_function : bool ,
@@ -1283,7 +1283,7 @@ impl NthSelectorData {
12831283/// The properties that comprise an :nth- pseudoclass as of Selectors 4 (e.g.,
12841284/// nth-child(An+B [of S]?)).
12851285/// https://www.w3.org/TR/selectors-4/#nth-child-pseudo
1286- #[ derive( Clone , PartialEq ) ]
1286+ #[ derive( Clone , PartialEq , Eq , Hash ) ]
12871287pub struct NthOfSelectorData < ' i , Impl : SelectorImpl < ' i > > ( NthSelectorData , Box < [ Selector < ' i , Impl > ] > ) ;
12881288
12891289impl < ' i , Impl : SelectorImpl < ' i > > NthOfSelectorData < ' i , Impl > {
@@ -1314,7 +1314,7 @@ impl<'i, Impl: SelectorImpl<'i>> NthOfSelectorData<'i, Impl> {
13141314/// optimal packing and cache performance, see [1].
13151315///
13161316/// [1] https://bugzilla.mozilla.org/show_bug.cgi?id=1357973
1317- #[ derive( Clone , PartialEq ) ]
1317+ #[ derive( Clone , PartialEq , Eq , Hash ) ]
13181318pub enum Component < ' i , Impl : SelectorImpl < ' i > > {
13191319 Combinator ( Combinator ) ,
13201320
@@ -1546,7 +1546,7 @@ impl<'i, Impl: SelectorImpl<'i>> Component<'i, Impl> {
15461546 }
15471547}
15481548
1549- #[ derive( Clone , Eq , PartialEq ) ]
1549+ #[ derive( Clone , Eq , PartialEq , Hash ) ]
15501550pub struct LocalName < ' i , Impl : SelectorImpl < ' i > > {
15511551 pub name : Impl :: LocalName ,
15521552 pub lower_name : Impl :: LocalName ,
@@ -2941,14 +2941,14 @@ pub mod tests {
29412941 use std:: collections:: HashMap ;
29422942 use std:: fmt;
29432943
2944- #[ derive( Clone , Debug , Eq , PartialEq ) ]
2944+ #[ derive( Clone , Debug , Eq , PartialEq , Hash ) ]
29452945 pub enum PseudoClass {
29462946 Hover ,
29472947 Active ,
29482948 Lang ( String ) ,
29492949 }
29502950
2951- #[ derive( Clone , Debug , Eq , PartialEq ) ]
2951+ #[ derive( Clone , Debug , Eq , PartialEq , Hash ) ]
29522952 pub enum PseudoElement {
29532953 Before ,
29542954 After ,
0 commit comments