Skip to content
This repository has been archived by the owner on Nov 12, 2022. It is now read-only.

Error E0277 on nightly #196

Closed
llacroix opened this issue Sep 18, 2015 · 7 comments
Closed

Error E0277 on nightly #196

llacroix opened this issue Sep 18, 2015 · 7 comments

Comments

@llacroix
Copy link

error: the trait core::clone::Clone is not implemented for the type unsafe extern "C" fn(*mut jsapi::JSContext, jsapi::Handle<*mut jsapi::JSObject>, jsapi::Handle<jsapi::jsid>, jsapi::Handle<jsapi::Value>, core::option::Option<unsafe extern "C" fn(*mut jsapi::JSContext, jsapi::Handle<*mut jsapi::JSObject>, jsapi::Handle<jsapi::jsid>, jsapi::MutableHandle<jsapi::Value>) -> u8>, core::option::Option<unsafe extern "C" fn(*mut jsapi::JSContext, jsapi::Handle<*mut jsapi::JSObject>, jsapi::Handle<jsapi::jsid>, jsapi::MutableHandle<jsapi::Value>, *mut jsapi::ObjectOpResult) -> u8>, u32, *mut jsapi::ObjectOpResult) -> u8 [E0277]
/home/llacroix/.cargo/git/checkouts/rust-mozjs-ebb4917e843c0a11/master/src/jsapi.rs:980 pub defineProperty: DefinePropertyOp,
/home/llacroix/.cargo/git/checkouts/rust-mozjs-ebb4917e843c0a11/master/src/jsapi.rs:977:16: 977:21 note: in this expansion of #[derive_Clone](defined in /home/llacroix/.cargo/git/checkouts/rust-mozjs-ebb4917e843c0a11/master/src/jsapi.rs)

I'm on nightly from 17/09/2015

@jdm
Copy link
Member

jdm commented Sep 18, 2015

rust-lang/rust#28229 perhaps?

@bjwbell
Copy link

bjwbell commented Sep 18, 2015

@jdm doesn't seem like it. rust-lang/rust#28229 exists with rustc 1.4.0-nightly (7780408af 2015-09-01) but rust-mozjs compiles ok.

@llacroix
Copy link
Author

@bjwbell I'll give a try with this version. It could be good to point out which rust version compile fine rust-mozjs.

@llacroix llacroix changed the title Error E0227 on nightly Error E0277 on nightly Sep 19, 2015
@llacroix
Copy link
Author

The problem seems to happen on these definitions:

pub type ReadTransferStructuredCloneOp =                                                                   
::std::option::Option<unsafe extern "C" fn
                          (cx: *mut JSContext,
                           r: *mut JSStructuredCloneReader, tag: u32,
                           content: *mut ::libc::c_void, extraData: u64,
                           closure: *mut ::libc::c_void,
                           returnObject: MutableHandleObject) -> u8>;
pub type TransferStructuredCloneOp =
::std::option::Option<unsafe extern "C" fn
                          (cx: *mut JSContext, obj: Handle<*mut JSObject>,
                           closure: *mut ::libc::c_void, tag: *mut u32,
                           ownership: *mut TransferableOwnership,
                           content: *mut *mut ::libc::c_void,
                           extraData: *mut u64) -> u8>;

pub type GetPropertyOp =                                                                                                     
::std::option::Option<unsafe extern "C" fn
                          (cx: *mut JSContext, obj: HandleObject,
                           receiver: HandleObject, id: HandleId,
                           vp: MutableHandleValue) -> u8>;
pub type SetPropertyOp =
::std::option::Option<unsafe extern "C" fn
                          (cx: *mut JSContext, obj: HandleObject,
                           receiver: HandleObject, id: HandleId,
                           vp: MutableHandleValue,
                           result: *mut ObjectOpResult) -> u8>;

pub type OpenAsmJSCacheEntryForReadOp =                                                   
::std::option::Option<unsafe extern "C" fn
                          (global: HandleObject, begin: *const i16,
                           limit: *const i16, size: *mut u32,
                           memory: *mut *const u8, handle: *mut i32)
                          -> u8>;
pub type CloseAsmJSCacheEntryForReadOp =
::std::option::Option<unsafe extern "C" fn
                          (size: u32, memory: *const u8, handle: i32)>;

Those six entries are causing the same error while expending [#derive_Clone] I'm not sure how those object types are much different from the other ones... As all the object I see that are declared in the struct are also Option.

@jdm
Copy link
Member

jdm commented Sep 19, 2015

I suspect it's the arguments that are raw pointers that are triggering this error, incorrectly.

@Manishearth
Copy link
Member

This is a regression, rust-lang/rust#28559

@llacroix
Copy link
Author

problem solved with this fix

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants