servo/components
bors-servo 8d8fea0b4b Auto merge of #16234 - mckaymatt:as_void_ptr_helper_method_15252, r=jdm
Add as_void_ptr helper method to &T

<!-- 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. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16234)
<!-- Reviewable:end -->
2017-04-04 18:12:31 -05:00
..
atoms Update serde to 0.9 (fixes #15325) 2017-02-18 21:09:46 +01:00
bluetooth Use servo_config::opts only on linux target. 2017-03-21 15:55:45 +01:00
bluetooth_traits Update serde to 0.9 (fixes #15325) 2017-02-18 21:09:46 +01:00
canvas Update WR (various optimizations, gradient improvements). 2017-04-03 06:48:27 +10:00
canvas_traits Kill serde_codegen 💣 2017-02-28 19:31:25 +01:00
compositing Update WR (various optimizations, gradient improvements). 2017-04-03 06:48:27 +10:00
config Rename ScreenPx to DeviceIndependentPixel. 2017-02-22 14:37:24 +10:00
constellation Terminate timer scheduler thread during shutdown 2017-03-30 14:27:40 +02:00
debugger Enable the debugger on Android 2017-03-17 16:36:06 +01:00
deny_public_fields Update syn to 0.11 2017-02-27 14:46:50 +01:00
devtools Update Hyper and OpenSSL 2017-03-31 16:32:21 +02:00
devtools_traits Update Hyper and OpenSSL 2017-03-31 16:32:21 +02:00
dom_struct Make #[dom_struct] a proc_macro attribute 2017-02-24 01:50:51 +01:00
domobject_derive Update syn to 0.11 2017-02-27 14:46:50 +01:00
geometry Rename ScreenPx to DeviceIndependentPixel. 2017-02-22 14:37:24 +10:00
gfx Serialize unquoted font-family without quote 2017-03-30 23:40:23 +03:00
gfx_traits Kill the plugins crate and its clippy support 2017-02-21 11:50:36 +01:00
jstraceable_derive Update syn to 0.11 2017-02-27 14:46:50 +01:00
layout Update WR (gradient features). 2017-04-05 05:40:29 +10:00
layout_thread Update WR (gradient features). 2017-04-05 05:40:29 +10:00
layout_traits Make ImageCacheImpl have a single Mutex<ImageCacheStore> and use ImageDecoderRunnable 2017-03-27 19:54:15 +02:00
msg Kill serde_codegen 💣 2017-02-28 19:31:25 +01:00
net Use set_default_accept in websocket_loader 2017-04-04 13:17:19 +02:00
net_traits Make Response::url_list be a bare Vec<ServoUrl> 2017-04-03 12:47:28 +02:00
profile Move trace file opening into TraceDump::new 2017-03-31 14:47:29 -07:00
profile_traits Kill the plugins crate and its clippy support 2017-02-21 11:50:36 +01:00
rand squash: convert less interesting debug! logs to traces 2017-01-18 22:21:41 -07:00
range Update serde to 0.9 (fixes #15325) 2017-02-18 21:09:46 +01:00
remutex squash: convert less interesting debug! logs to traces 2017-01-18 22:21:41 -07:00
script Add way to get c_void ptr or c_char from caller 2017-04-04 16:46:52 -04:00
script_layout_interface Use a more compact representation to store eager pseudo-elements. 2017-04-03 14:34:23 -07:00
script_plugins Upgrade to rustc 1.18.0-nightly (474f7a91e 2017-03-31) 2017-03-31 15:09:04 +02:00
script_traits Auto merge of #15868 - servo:hyper, r=jdm 2017-03-31 11:46:09 -05:00
selectors Bug 1345950: stylo: Fix slow selector flags. r=bholley 2017-03-22 11:21:24 +01:00
servo Make image cache per-document rather than global 2017-03-27 19:54:13 +02:00
style Auto merge of #16242 - pyfisch:transform-one, r=emilio 2017-04-04 15:30:23 -05:00
style_traits Implement serialization for transform functions. 2017-04-04 19:04:19 +02:00
url Remove some useless Option<T> wrappers from ServoUrl methods 2017-03-26 16:15:06 +02:00
webdriver_server Update Hyper and OpenSSL 2017-03-31 16:32:21 +02:00
webvr Kill serde_codegen 💣 2017-02-28 19:31:25 +01:00
webvr_traits Remove unused features from webvr traits 2017-02-21 11:00:03 +01:00