From 3104cf76fc0ceffec78bcbf430faabd524864d2c Mon Sep 17 00:00:00 2001 From: Jack Moffitt Date: Mon, 4 Aug 2014 22:56:50 -0600 Subject: [PATCH] Upgrade Rust. --- rust.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rust.rs b/rust.rs index 7a48fdf0e..1f23807f6 100644 --- a/rust.rs +++ b/rust.rs @@ -9,6 +9,7 @@ use libc::c_char; use std::cmp; use std::rc; use std::rt::Runtime; +use std::string; use jsapi::*; use jsval::{JSVal, NullValue}; use default_stacksize; @@ -17,7 +18,6 @@ use JSOPTION_VAROBJFIX; use JSOPTION_METHODJIT; use JSOPTION_TYPE_INFERENCE; use ERR; -use std::str::raw::from_c_str; use green::task::GreenTask; // ___________________________________________________________________________ @@ -164,9 +164,9 @@ impl Cx { pub extern fn reportError(_cx: *mut JSContext, msg: *const c_char, report: *mut JSErrorReport) { unsafe { let fnptr = (*report).filename; - let fname = if fnptr.is_not_null() {from_c_str(fnptr)} else {"none".to_string()}; + 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 = from_c_str(msg); + let msg = string::raw::from_buf(msg as *const i8 as *const u8); error!("Error at {:s}:{}: {:s}\n", fname, lineno, msg); } }