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

error: Could not compile `mozjs`. #21790

Closed
hubertmok opened this issue Sep 23, 2018 · 3 comments
Closed

error: Could not compile `mozjs`. #21790

hubertmok opened this issue Sep 23, 2018 · 3 comments

Comments

@hubertmok
Copy link

@hubertmok hubertmok commented Sep 23, 2018

During compile servo project on ubuntu 16.04, it show the following error message:


warning: redundant linker flag specified for library stdc++

error[E0277]: the trait bound `u8: std::convert::From<rust::MutableHandle<'_, u8>>` is not satisfied
    --> /home/hubert/.cargo/registry/src/github.com-1ecc6299db9ec823/mozjs-0.9.1/src/rust.rs:1205:52
     |
1205 |             wrap!(@inner $saved <> ($($acc,)* $arg.into(),) <> $($rest)*);
     |                                                    ^^^^ the trait `std::convert::From<rust::MutableHandle<'_, u8>>` is not implemented for `u8`
     | 
    ::: /home/hubert/.cargo/registry/src/github.com-1ecc6299db9ec823/mozjs-0.9.1/src/jsapi_wrappers.in:44:1
     |
44   | wrap!(jsapi: pub fn FinishMultiOffThreadScriptsDecoder(cx: *mut JSContext, token: *mut ::std::os::raw::c_void, scripts: MutableHandle<ScriptVector>) -> bool);
     | -------------------------------------------------------------------------------------------------------------------------------------------------------------- in this macro invocation
     |
     = help: the following implementations were found:
               <u8 as std::convert::From<bool>>
     = note: required because of the requirements on the impl of `std::convert::Into<u8>` for `rust::MutableHandle<'_, u8>`

error[E0277]: the trait bound `u8: std::convert::From<rust::MutableHandle<'_, u8>>` is not satisfied
    --> /home/hubert/.cargo/registry/src/github.com-1ecc6299db9ec823/mozjs-0.9.1/src/rust.rs:1348:113
     |
1348 |             wrap!(@inner $saved <> ($($declargs)* $arg: &mut MutableHandle<$gentype> , )  <> ($($acc,)* (*$arg).into(),) <> $($rest)*);
     |                                                                                                                 ^^^^ the trait `std::convert::From<rust::MutableHandle<'_, u8>>` is not implemented for `u8`
     | 
    ::: /home/hubert/.cargo/registry/src/github.com-1ecc6299db9ec823/mozjs-0.9.1/src/jsapi_wrappers.in:44:1
     |
44   | wrap!(jsapi: pub fn FinishMultiOffThreadScriptsDecoder(cx: *mut JSContext, token: *mut ::std::os::raw::c_void, scripts: MutableHandle<ScriptVector>) -> bool);
     | -------------------------------------------------------------------------------------------------------------------------------------------------------------- in this macro invocation
     |
     = help: the following implementations were found:
               <u8 as std::convert::From<bool>>
     = note: required because of the requirements on the impl of `std::convert::Into<u8>` for `rust::MutableHandle<'_, u8>`

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0277`.
The following warnings were emitted during compilation:

warning: src/jsglue.cpp: In functionvoid DeleteCompileOptions(JS::ReadOnlyCompileOptions*)’:
warning: src/jsglue.cpp:586:57: warning: deleting object of polymorphic class typeJS::OwningCompileOptionswhich has non-virtual destructor might cause undefined behaviour [-Wdelete-non-virtual-dtor]
warning:      delete static_cast<JS::OwningCompileOptions *>(aOpts);
warning:                                                          ^
warning: At global scope:
warning: cc1plus: warning: unrecognized command line option ‘-Wno-return-type-c-linkagewarning: cc1plus: warning: unrecognized command line option ‘-Wno-c++0x-extensionserror: Could not compile `mozjs`.
warning: build failed, waiting for other jobs to finish...
error: build failed
[Warning] Could not generate notification! Optional Python module 'dbus' is not installed.
Build FAILED in 0:27:14
@jdm
Copy link
Member

@jdm jdm commented Sep 23, 2018

This happens when the installed version of rustfmt is too old.

@hubertmok
Copy link
Author

@hubertmok hubertmok commented Sep 24, 2018

I have updated the rustfmt to version 0.99.4-nightly and still have this issue

@hubertmok
Copy link
Author

@hubertmok hubertmok commented Sep 25, 2018

Thx @jdm, after update clang version, it works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.