Skip to content

Commit dad594e

Browse files
committed
---
yaml --- r: 64654 b: refs/heads/snap-stage3 c: 3b818ed h: refs/heads/master v: v3
1 parent 36f3789 commit dad594e

File tree

4 files changed

+12
-20
lines changed

4 files changed

+12
-20
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: cf75330807ad908a428e9c162a388e367fb07781
4+
refs/heads/snap-stage3: 3b818edeba4dbca7c605ca5600f2d1b4b000120b
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/libstd/rt/borrowck.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ unsafe fn fail_borrowed(box: *mut BoxRepr, file: *c_char, line: size_t) {
7676
match try_take_task_borrow_list() {
7777
None => { // not recording borrows
7878
let msg = "borrowed";
79-
do msg.as_buf |msg_p, _| {
79+
do msg.as_c_str |msg_p| {
8080
sys::begin_unwind_(msg_p as *c_char, file, line);
8181
}
8282
}
@@ -92,7 +92,7 @@ unsafe fn fail_borrowed(box: *mut BoxRepr, file: *c_char, line: size_t) {
9292
sep = " and at ";
9393
}
9494
}
95-
do msg.as_buf |msg_p, _| {
95+
do msg.as_c_str |msg_p| {
9696
sys::begin_unwind_(msg_p as *c_char, file, line)
9797
}
9898
}
@@ -231,7 +231,7 @@ pub unsafe fn unrecord_borrow(a: *u8, old_ref_count: uint,
231231
let br = borrow_list.pop();
232232
if br.box != a || br.file != file || br.line != line {
233233
let err = fmt!("wrong borrow found, br=%?", br);
234-
do err.as_buf |msg_p, _| {
234+
do err.as_c_str |msg_p| {
235235
sys::begin_unwind_(msg_p as *c_char, file, line)
236236
}
237237
}

branches/snap-stage3/src/libstd/sys.rs

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -123,27 +123,19 @@ pub trait FailWithCause {
123123

124124
impl FailWithCause for ~str {
125125
fn fail_with(cause: ~str, file: &'static str, line: uint) -> ! {
126-
do cause.as_buf |msg_buf, _msg_len| {
127-
do file.as_buf |file_buf, _file_len| {
128-
unsafe {
129-
let msg_buf = cast::transmute(msg_buf);
130-
let file_buf = cast::transmute(file_buf);
131-
begin_unwind_(msg_buf, file_buf, line as libc::size_t)
132-
}
126+
do cause.as_c_str |msg_buf| {
127+
do file.as_c_str |file_buf| {
128+
begin_unwind_(msg_buf, file_buf, line as libc::size_t)
133129
}
134130
}
135131
}
136132
}
137133

138134
impl FailWithCause for &'static str {
139135
fn fail_with(cause: &'static str, file: &'static str, line: uint) -> ! {
140-
do cause.as_buf |msg_buf, _msg_len| {
141-
do file.as_buf |file_buf, _file_len| {
142-
unsafe {
143-
let msg_buf = cast::transmute(msg_buf);
144-
let file_buf = cast::transmute(file_buf);
145-
begin_unwind_(msg_buf, file_buf, line as libc::size_t)
146-
}
136+
do cause.as_c_str |msg_buf| {
137+
do file.as_c_str |file_buf| {
138+
begin_unwind_(msg_buf, file_buf, line as libc::size_t)
147139
}
148140
}
149141
}

branches/snap-stage3/src/libstd/unstable/lang.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ pub fn fail_bounds_check(file: *c_char, line: size_t,
5656
index: size_t, len: size_t) {
5757
let msg = fmt!("index out of bounds: the len is %d but the index is %d",
5858
len as int, index as int);
59-
do msg.as_buf |p, _len| {
60-
fail_(p as *c_char, file, line);
59+
do msg.as_c_str |buf| {
60+
fail_(buf, file, line);
6161
}
6262
}
6363

0 commit comments

Comments
 (0)