Closed Bug 1406811 Opened 2 years ago Closed 2 years ago

stylo: Mismatches arguments for ServoSelectorList

Categories

(Core :: CSS Parsing and Computation, defect, P4)

defect

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox57 --- unaffected
firefox58 --- fixed

People

(Reporter: hiro, Assigned: hiro)

References

Details

Attachments

(3 files)

It causes errors on mach test-stylo when updating bindings like this.


error[E0308]: mismatched types
  --> /home/ikezoe/servo/target/geckolib/debug/build/stylo_tests-e6140111dc9425ff/out/check_bindings.rs:35:32
   |
35 |     [ Servo_SelectorList_Drop, bindings::Servo_SelectorList_Drop ];
   |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected *-ptr, found struct `style::gecko_bindings::sugar::ownership::Owned`
   |
   = note: expected type `unsafe extern "C" fn(*mut selectors::SelectorList<style::selector_parser::SelectorImpl>) {servo_function_signatures::glue::Servo_SelectorList_Drop}`
              found type `unsafe extern "C" fn(style::gecko_bindings::sugar::ownership::Owned<style::gecko_bindings::structs::RawServoSelectorList>) {style::gecko_bindings::bindings::Servo_SelectorList_Drop}`

error[E0308]: mismatched types
  --> /home/ikezoe/servo/target/geckolib/debug/build/stylo_tests-e6140111dc9425ff/out/check_bindings.rs:69:33
   |
69 |     [ Servo_SelectorList_Parse, bindings::Servo_SelectorList_Parse ];
   |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `selectors::SelectorList`, found struct `style::gecko_bindings::structs::RawServoSelectorList`
   |
   = note: expected type `unsafe extern "C" fn(*const style::<unnamed>::nsACString) -> *mut selectors::SelectorList<style::selector_parser::SelectorImpl> {servo_function_signatures::glue::Servo_SelectorList_Parse}`
              found type `unsafe extern "C" fn(*const style::<unnamed>::nsACString) -> *mut style::gecko_bindings::structs::RawServoSelectorList {style::gecko_bindings::bindings::Servo_SelectorList_Parse}`

error[E0308]: mismatched types
  --> /home/ikezoe/servo/target/geckolib/debug/build/stylo_tests-e6140111dc9425ff/out/check_bindings.rs:70:35
   |
70 |     [ Servo_SelectorList_Matches, bindings::Servo_SelectorList_Matches ];
   |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `selectors::SelectorList`, found struct `style::gecko_bindings::structs::RawServoSelectorList`
   |
   = note: expected type `unsafe extern "C" fn(&style::gecko_bindings::structs::Element, &selectors::SelectorList<style::selector_parser::SelectorImpl>) -> bool {servo_function_signatures::glue::Servo_SelectorList_Matches}`
              found type `unsafe extern "C" fn(&style::gecko_bindings::structs::Element, &style::gecko_bindings::structs::RawServoSelectorList) -> bool {style::gecko_bindings::bindings::Servo_SelectorList_Matches}`

https://treeherder.mozilla.org/#/jobs?repo=try&revision=2da3876846051a57277575fd8bc6205470f83f3c
Summary: Mismatches arguments for ServoSelectorList → stylo: Mismatches arguments for ServoSelectorList
Comment on attachment 8916468 [details]
Bug 1406811 - Fix mismatched arguments for Servo_SelectorXXX.

https://reviewboard.mozilla.org/r/187590/#review192624

r=me, thanks!
Attachment #8916468 - Flags: review?(emilio) → review+
Do'h.  This patch does not solve the failures on test-stylo.  The declarations should exactly match?
Comment on attachment 8916468 [details]
Bug 1406811 - Fix mismatched arguments for Servo_SelectorXXX.

Emilio, would you mind re-reviewing this?  I had to add HasBoxFFI and relevant traits for SelectorList to match the arguments.
Attachment #8916468 - Flags: review+ → review?(emilio)
Comment on attachment 8916777 [details]
Bug 1406811 - Remove a duplicate entry for RawServoSelectorListBorrowed.

https://reviewboard.mozilla.org/r/187838/#review192902
Attachment #8916777 - Flags: review?(emilio) → review+
Comment on attachment 8916468 [details]
Bug 1406811 - Fix mismatched arguments for Servo_SelectorXXX.

r=me on this one too, if this makes the tests green, but I really rather rethink all this boilerplate.

This is a lot of code, and looks like a regression in readability from the original one IMO, with no clear safety benefit, wdyt?
Attachment #8916468 - Flags: review?(emilio) → review+
Yeah, I'd actually prefer the original one if it can not be safer.
Attached file Servo PR
Priority: -- → P4
Pushed by hikezoe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/0a994a272856
Fix mismatched arguments for Servo_SelectorXXX. r=emilio
https://hg.mozilla.org/integration/autoland/rev/5ccff8bf69d6
Remove a duplicate entry for RawServoSelectorListBorrowed. r=emilio
https://hg.mozilla.org/mozilla-central/rev/0a994a272856
https://hg.mozilla.org/mozilla-central/rev/5ccff8bf69d6
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in before you can comment on or make changes to this bug.