gecko-dev/servo/components/script/dom/bindings/codegen
mckaymatt 6e2525b4fd servo: Merge #16234 - Add as_void_ptr helper method to &T (from mckaymatt:as_void_ptr_helper_method_15252); r=jdm
<!-- Please describe your changes on the following line: -->
r? @jdm
issue https://github.com/servo/servo/issues/15252
The primary goal of this PR is to add add a generic trait method that returns a void ptr.

In addition to that change, I made the casting explicit in `components/script/dom/bindings/callback.rs`  and `components/script/dom/promise.rs`. I did not use the new trait method because `AddRawValueRoot` is not looking for a `c_void`. It's looking for `std::os::raw::c_char`.
```rust
pub fn AddRawValueRoot(cx: *mut JSContext, vp: *mut Value,
                                          name: *const ::std::os::raw::c_char) -> bool;
```
So I replace the `as *const _ ` with a more specific cast.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #15252

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because
 This seems like code cleanup. It shouldn't change behaviour.

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: 8d8fea0b4bf323be42eff3ad5624ce33892fb6df

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : d5992625f30523ee372f54d0005b211d6c9a6b41
2017-04-04 18:12:31 -05:00
..
parser servo: Merge #13596 - Get rid of dom::bindings::global (from nox:inline); r=Ms2ger 2016-10-07 07:52:09 -05:00
ply servo: Merge #3230 - Cargoify servo (from servo:cargoify) 2014-09-09 08:18:18 -06:00
api.html.template servo: Merge #12451 - Generate a list of supported DOM APIs from parsed WebIDLs (from jdm:generate-dom-apis); r=Ms2ger 2016-07-15 15:13:22 -07:00
apis.html.template servo: Merge #12451 - Generate a list of supported DOM APIs from parsed WebIDLs (from jdm:generate-dom-apis); r=Ms2ger 2016-07-15 15:13:22 -07:00
BindingGen.py servo: Merge #9188 - Remove unused command-line Python codegen arguments (from frewsxcv:unused-codegen-options); r=Manishearth 2016-01-09 09:51:45 +05:01
Bindings.conf servo: Merge #13453 - Implement matchMedia and MediaQueryList (from metajack:media-query-list); r=jdm 2016-11-02 14:51:12 -05:00
CodegenRust.py servo: Merge #16234 - Add as_void_ptr helper method to &T (from mckaymatt:as_void_ptr_helper_method_15252); r=jdm 2017-04-04 18:12:31 -05:00
Configuration.py servo: Merge #15451 - Improve code around typedefs (from servo:typedefs); r=nox 2017-02-08 04:18:44 -08:00
GlobalGen.py servo: Merge #15099 - Remove usage of phf_macros (from servo:phf-no-macros); r=jdm 2017-01-20 08:59:26 -08:00
interface.html.template servo: Merge #12451 - Generate a list of supported DOM APIs from parsed WebIDLs (from jdm:generate-dom-apis); r=Ms2ger 2016-07-15 15:13:22 -07:00
property.html.template servo: Merge #12451 - Generate a list of supported DOM APIs from parsed WebIDLs (from jdm:generate-dom-apis); r=Ms2ger 2016-07-15 15:13:22 -07:00
pythonpath.py servo: Merge #11756 - MSVC support for Servo, and CMake builds for native code (from vvuk:servo-msvc); r=larsbergstrom 2016-08-17 13:22:52 -05:00