// option. This file may not be copied, modified, or distributed
// except according to those terms.
+use c_str::ToCStr;
use cast::transmute;
use libc::{c_char, c_void, size_t, STDERR_FILENO};
use io;
match try_take_task_borrow_list() {
None => { // not recording borrows
let msg = "borrowed";
- do msg.as_c_str |msg_p| {
- sys::begin_unwind_(msg_p as *c_char, file, line);
+ do msg.to_c_str().with_ref |msg_p| {
+ sys::begin_unwind_(msg_p, file, line);
}
}
Some(borrow_list) => { // recording borrows
sep = " and at ";
}
}
- do msg.as_c_str |msg_p| {
- sys::begin_unwind_(msg_p as *c_char, file, line)
+ do msg.to_c_str().with_ref |msg_p| {
+ sys::begin_unwind_(msg_p, file, line)
}
}
}
let br = borrow_list.pop();
if br.box != a || br.file != file || br.line != line {
let err = fmt!("wrong borrow found, br=%?", br);
- do err.as_c_str |msg_p| {
- sys::begin_unwind_(msg_p as *c_char, file, line)
+ do err.to_c_str().with_ref |msg_p| {
+ sys::begin_unwind_(msg_p, file, line)
}
}
borrow_list