33
33
use fmt;
34
34
use intrinsics;
35
35
36
+ // NOTE: remove after next snapshot
37
+ #[ cfg( stage0) ]
36
38
#[ cold] #[ inline( never) ] // this is the slow path, always
37
39
#[ lang="fail_" ]
38
40
fn fail_ ( expr_file_line : & ( & ' static str , & ' static str , uint ) ) -> ! {
@@ -45,6 +47,19 @@ fn fail_(expr_file_line: &(&'static str, &'static str, uint)) -> ! {
45
47
unsafe { intrinsics:: abort ( ) }
46
48
}
47
49
50
+ #[ cfg( not( stage0) ) ]
51
+ #[ cold] #[ inline( never) ] // this is the slow path, always
52
+ #[ lang="fail" ]
53
+ fn fail ( expr_file_line : & ( & ' static str , & ' static str , uint ) ) -> ! {
54
+ let ( expr, file, line) = * expr_file_line;
55
+ let ref file_line = ( file, line) ;
56
+ format_args ! ( |args| -> ( ) {
57
+ fail_impl( args, file_line) ;
58
+ } , "{}" , expr) ;
59
+
60
+ unsafe { intrinsics:: abort ( ) }
61
+ }
62
+
48
63
#[ cold] #[ inline( never) ]
49
64
#[ lang="fail_bounds_check" ]
50
65
fn fail_bounds_check ( file_line : & ( & ' static str , uint ) ,
@@ -65,6 +80,7 @@ pub fn fail_impl(fmt: &fmt::Arguments, file_line: &(&'static str, uint)) -> ! {
65
80
#[ allow( ctypes) ]
66
81
extern {
67
82
83
+ // NOTE: remove after next snapshot
68
84
#[ cfg( stage0) ]
69
85
#[ lang = "begin_unwind" ]
70
86
fn fail_impl ( fmt : & fmt:: Arguments , file : & ' static str ,
@@ -79,4 +95,3 @@ pub fn fail_impl(fmt: &fmt::Arguments, file_line: &(&'static str, uint)) -> ! {
79
95
let ( file, line) = * file_line;
80
96
unsafe { fail_impl ( fmt, file, line) }
81
97
}
82
-
0 commit comments