diff --git a/src/jsval.rs b/src/jsval.rs index 8b5b35428..7e196ea04 100644 --- a/src/jsval.rs +++ b/src/jsval.rs @@ -82,7 +82,7 @@ const JSVAL_PAYLOAD_MASK: u64 = 0x00007FFFFFFFFFFF; // JSVal was originally type of u64. // now this become {u64} because of the union abi issue on ARM arch. See #398. -#[deriving(PartialEq,Clone)] +#[deriving(PartialEq, Clone, Copy)] pub struct JSVal { pub v: u64 } diff --git a/src/lib.rs b/src/lib.rs index 7ea1872f4..283f2d60d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -127,6 +127,7 @@ pub unsafe fn JS_CALLEE(_cx: *mut JSContext, vp: *mut JSVal) -> JSVal { pub type JSObjectOp = extern "C" fn(*mut JSContext, JSHandleObject) -> *mut JSObject; +#[deriving(Copy)] pub struct Class { pub name: *const libc::c_char, pub flags: uint32_t, @@ -148,6 +149,7 @@ pub struct Class { pub ops: ObjectOps, } +#[deriving(Copy)] pub struct ClassExtension { pub equality: *const u8, pub outerObject: Option, @@ -157,6 +159,7 @@ pub struct ClassExtension { pub isWrappedNative: *const u8, } +#[deriving(Copy)] pub struct ObjectOps { pub lookupGeneric: *const u8, pub lookupProperty: *const u8, diff --git a/src/rust.rs b/src/rust.rs index cd73c43da..dbbcfcac2 100644 --- a/src/rust.rs +++ b/src/rust.rs @@ -9,7 +9,6 @@ use libc::uintptr_t; use libc::c_char; use std::cmp; use std::rc; -use std::rt::Runtime; use std::string; use jsapi::*; use jsapi::JSVersion::JSVERSION_LATEST; @@ -124,7 +123,7 @@ impl Cx { let script_utf16: Vec = script.as_slice().utf16_units().collect(); let filename_cstr = filename.to_c_str(); let mut rval: JSVal = NullValue(); - debug!("Evaluating script from {:s} with content {}", filename, script); + debug!("Evaluating script from {} with content {}", filename, script); // SpiderMonkey does not approve of null pointers. let (ptr, len) = if script_utf16.len() == 0 { static empty: &'static [u16] = &[]; @@ -154,7 +153,7 @@ pub unsafe extern fn reportError(_cx: *mut JSContext, msg: *const c_char, report let fname = if fnptr.is_not_null() {string::raw::from_buf(fnptr as *const i8 as *const u8)} else {"none".to_string()}; let lineno = (*report).lineno; let msg = string::raw::from_buf(msg as *const i8 as *const u8); - error!("Error at {:s}:{}: {:s}\n", fname, lineno, msg); + error!("Error at {}:{}: {}\n", fname, lineno, msg); } pub fn with_compartment(cx: *mut JSContext, object: *mut JSObject, cb: || -> R) -> R {