servo / rust-mozjs

DEPRECATED - moved to servo/mozjs instead.
Mozilla Public License 2.0
293 stars 122 forks source link

building servo on ubuntu 16.04 fails at mozjs #435

Open paddywwoof opened 6 years ago

paddywwoof commented 6 years ago

not clear how this error can be fixed without altering the source.

   Compiling mozjs v0.8.0                                                       
error[E0277]: the trait bound `u8: std::convert::From<rust::MutableHandle<'_, u8>>` is not satisfied
    -->.../mozjs-0.8.0/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`
     | 
    ::: .../mozjs-0.8.0/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
    --> .../mozjs-0.8.0/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`
     | 
    .../mozjs-0.8.0/src/jsapi_wrappers.in:44:1
jdm commented 6 years ago

This is caused by a too-old version of llvm being used for libclang. Replacing it with a newer version should make it go away.

jdm commented 6 years ago

Oh, this may be caused by a version of clang that is less than 3.9.

rohit-136 commented 5 years ago

@jdm
I updated my clang version to version 6 but it still shows the same error. error

jdm commented 5 years ago

@rohit-136 In general, that means that you have an older version of clang that is being found before the updated version.

rohit-136 commented 5 years ago

@jdm I uninstalled clang 3.8 just to be sure and installed clang 6.0.1. The error persists even then.