Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adapt to #[deny(transmute_from_fn_item_types)] #108

Merged
merged 1 commit into from
Sep 6, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/internal/js/class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ pub trait ClassInternal: Class {

let (call_callback, call_kernel) = match descriptor.call {
Some(k) => k.export(),
None => (mem::transmute(ConstructorCallKernel::unimplemented::<Self>), null_mut())
None => (mem::transmute(ConstructorCallKernel::unimplemented::<Self> as usize), null_mut())
};

let metadata_pointer = neon_sys::class::create_base(isolate,
Expand Down
6 changes: 3 additions & 3 deletions src/internal/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ impl IsolateInternal for Isolate {
let b: Box<ClassMap> = Box::new(ClassMap::new());
let raw = Box::into_raw(b);
ptr = unsafe { mem::transmute(raw) };
let free_map: *mut c_void = unsafe { mem::transmute(drop_class_map) };
let free_map: *mut c_void = unsafe { mem::transmute(drop_class_map as usize) };
unsafe {
neon_sys::class::set_class_map(self.to_raw(), ptr, free_map);
}
Expand Down Expand Up @@ -176,7 +176,7 @@ impl<'a> Module<'a> {
let mut scope = RootScope::new(unsafe { mem::transmute(neon_sys::object::get_isolate(exports.to_raw())) });
unsafe {
let kernel: *mut c_void = mem::transmute(init);
let callback: extern "C" fn(*mut c_void, *mut c_void, *mut c_void) = mem::transmute(module_callback);
let callback: extern "C" fn(*mut c_void, *mut c_void, *mut c_void) = mem::transmute(module_callback as usize);
let exports: raw::Local = exports.to_raw();
let scope: *mut c_void = mem::transmute(&mut scope);
neon_sys::module::exec_kernel(kernel, callback, exports, scope);
Expand Down Expand Up @@ -270,7 +270,7 @@ pub trait Kernel<T: Clone + Copy + Sized>: Sized {
/// and the kernel function, both converted to raw void pointers.
fn export(self) -> (*mut c_void, *mut c_void) {
unsafe {
(mem::transmute(Self::callback), self.as_ptr())
(mem::transmute(Self::callback as usize), self.as_ptr())
}
}
}
Expand Down