Skip to content

Commit ca8de92

Browse files
committed
---
yaml --- r: 35264 b: refs/heads/master c: 07f4031 h: refs/heads/master v: v3
1 parent e650357 commit ca8de92

File tree

3 files changed

+27
-4
lines changed

3 files changed

+27
-4
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 61cfec3c52d3ac316b627c4b20c9c6e81e7521f2
2+
refs/heads/master: 07f4031bb40967f9c5c0ee61b71e1d9cffd34b58
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: eb8fd119c65c67f3b1b8268cc7341c22d39b7b61
55
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024

trunk/src/libcore/rt.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,12 @@ extern mod rustrt {
3434
// 'rt_', otherwise the compiler won't find it. To fix this, see
3535
// gather_rust_rtcalls.
3636
#[rt(fail_)]
37-
pub fn rt_fail_(expr: *c_char, file: *c_char, line: size_t) {
38-
cleanup_stack_for_failure();
39-
rustrt::rust_upcall_fail(expr, file, line);
37+
pub fn rt_fail_(expr: *c_char, file: *c_char, line: size_t) -> ! {
38+
unsafe {
39+
cleanup_stack_for_failure();
40+
rustrt::rust_upcall_fail(expr, file, line);
41+
cast::transmute(())
42+
}
4043
}
4144

4245
#[rt(fail_bounds_check)]

trunk/src/libsyntax/ext/expand.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,26 @@ fn core_macros() -> ~str {
248248
#macro[[#warn[f, ...], log(core::warn, #fmt[f, ...])]];
249249
#macro[[#info[f, ...], log(core::info, #fmt[f, ...])]];
250250
#macro[[#debug[f, ...], log(core::debug, #fmt[f, ...])]];
251+
252+
macro_rules! die(
253+
($msg: expr) => (
254+
{
255+
do core::str::as_buf($msg) |msg_buf, _msg_len| {
256+
do core::str::as_buf(file!()) |file_buf, _file_len| {
257+
unsafe {
258+
let msg_buf = core::cast::transmute(msg_buf);
259+
let file_buf = core::cast::transmute(file_buf);
260+
let line = line!() as core::libc::size_t;
261+
core::rt::rt_fail_(msg_buf, file_buf, line)
262+
}
263+
}
264+
}
265+
}
266+
);
267+
() => (
268+
die!(\"explicit failure\")
269+
)
270+
)
251271
}";
252272
}
253273

0 commit comments

Comments
 (0)