diff options
| author | Erick Tryzelaar <erick.tryzelaar@gmail.com> | 2013-07-22 21:45:33 -0700 |
|---|---|---|
| committer | Erick Tryzelaar <erick.tryzelaar@gmail.com> | 2013-07-23 16:56:22 -0700 |
| commit | 3b818edeba4dbca7c605ca5600f2d1b4b000120b (patch) | |
| tree | debfc8b7cbf00f368b3f4267048c877ad9549f2a /src/libstd/rt | |
| parent | cf75330807ad908a428e9c162a388e367fb07781 (diff) | |
| download | rust-3b818edeba4dbca7c605ca5600f2d1b4b000120b.tar.gz rust-3b818edeba4dbca7c605ca5600f2d1b4b000120b.zip | |
std and extra: use as_c_str instead of as_buf in a couple places
These uses are assuming the strings are null terminated, so it should be using `as_c_str` instead of `as_buf`
Diffstat (limited to 'src/libstd/rt')
| -rw-r--r-- | src/libstd/rt/borrowck.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libstd/rt/borrowck.rs b/src/libstd/rt/borrowck.rs index 42e545ce1a9..1a468fcf215 100644 --- a/src/libstd/rt/borrowck.rs +++ b/src/libstd/rt/borrowck.rs @@ -76,7 +76,7 @@ unsafe fn fail_borrowed(box: *mut BoxRepr, file: *c_char, line: size_t) { match try_take_task_borrow_list() { None => { // not recording borrows let msg = "borrowed"; - do msg.as_buf |msg_p, _| { + do msg.as_c_str |msg_p| { sys::begin_unwind_(msg_p as *c_char, file, line); } } @@ -92,7 +92,7 @@ unsafe fn fail_borrowed(box: *mut BoxRepr, file: *c_char, line: size_t) { sep = " and at "; } } - do msg.as_buf |msg_p, _| { + do msg.as_c_str |msg_p| { sys::begin_unwind_(msg_p as *c_char, file, line) } } @@ -231,7 +231,7 @@ pub unsafe fn unrecord_borrow(a: *u8, old_ref_count: uint, 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_buf |msg_p, _| { + do err.as_c_str |msg_p| { sys::begin_unwind_(msg_p as *c_char, file, line) } } |
