kuchiki-rs / kuchiki

(朽木) HTML/XML tree manipulation library for Rust
MIT License
470 stars 54 forks source link

Cannot build with a local cssparser copy #54

Closed RazrFalcon closed 5 years ago

RazrFalcon commented 5 years ago

I've downloaded rust-cssparser-0.24.1 and added cssparser = { path = "../rust-cssparser-0.24.1" } to the Cargo.toml, but I'm getting:

error[E0277]: the trait bound `select::PseudoElement: cssparser::serializer::ToCss` is not satisfied
  --> src/select.rs:25:6
   |
25 | impl SelectorImpl for KuchikiSelectors {
   |      ^^^^^^^^^^^^ the trait `cssparser::serializer::ToCss` is not implemented for `select::PseudoElement`

error[E0277]: the trait bound `select::PseudoClass: cssparser::serializer::ToCss` is not satisfied
  --> src/select.rs:25:6
   |
25 | impl SelectorImpl for KuchikiSelectors {
   |      ^^^^^^^^^^^^ the trait `cssparser::serializer::ToCss` is not implemented for `select::PseudoClass`

error[E0277]: the trait bound `select::PseudoClass: cssparser::serializer::ToCss` is not satisfied
  --> src/select.rs:82:6
   |
82 | impl NonTSPseudoClass for PseudoClass {
   |      ^^^^^^^^^^^^^^^^ the trait `cssparser::serializer::ToCss` is not implemented for `select::PseudoClass`

error[E0277]: the trait bound `select::PseudoElement: cssparser::serializer::ToCss` is not satisfied
   --> src/select.rs:117:6
    |
117 | impl selectors::parser::PseudoElement for PseudoElement {
    |      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `cssparser::serializer::ToCss` is not implemented for `select::PseudoElement`

Not sure why it doesn't work, because if we use cssparser-0.24.1 from crates.io - everything is ok.

SimonSapin commented 5 years ago

Kuchiki also depends on selectors from crates.io which depends on cssparser from crates.io, and that latter dependency is public (part of selectorss public API). Try [patch] instead? https://doc.rust-lang.org/cargo/reference/manifest.html#the-patch-section

RazrFalcon commented 5 years ago

Fixed. Thanks.