Created
April 22, 2014 00:58
-
-
Save larsbergstrom/11161846 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /Users/larsberg/servo/src/components/script/dom/bindings/codegen/EventListenerBinding.rs:72:3: 72:28 error: expected serialize::serialize::Encoder<()>, but found serialize::serialize::Encoder<__E> (expected () but found type parameter) | |
| /Users/larsberg/servo/src/components/script/dom/bindings/codegen/EventListenerBinding.rs:72 parent: CallbackInterface, | |
| ^~~~~~~~~~~~~~~~~~~~~~~~~ | |
| note: in expansion of #[deriving] |
larsbergstrom
commented
Apr 22, 2014
Author
Author
#[deriving(Clone,Eq)]
pub struct CallbackInterface {
callback: *JSObject
}
impl<S: Encoder<()>> Encodable<S, ()> for CallbackInterface {
fn encode(&self, s: &mut S) -> Result<(), ()> {
unsafe {
let tracer: *mut JSTracer = cast::transmute(s);
"callback".to_c_str().with_ref(|name| {
(*tracer).debugPrinter = ptr::null();
(*tracer).debugPrintIndex = -1;
(*tracer).debugPrintArg = name as *libc::c_void;
JS_CallTracer(tracer as *JSTracer, self.callback, JSTRACE_OBJECT as u32);
});
};
Ok(())
}
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment