3333use fmt;
3434use intrinsics;
3535
36+ // NOTE: remove after next snapshot
37+ #[ cfg( stage0) ]
3638#[ cold] #[ inline( never) ] // this is the slow path, always
3739#[ lang="fail_" ]
3840fn fail_ ( expr_file_line : & ( & ' static str , & ' static str , uint ) ) -> ! {
@@ -45,6 +47,19 @@ fn fail_(expr_file_line: &(&'static str, &'static str, uint)) -> ! {
4547 unsafe { intrinsics:: abort ( ) }
4648}
4749
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+
4863#[ cold] #[ inline( never) ]
4964#[ lang="fail_bounds_check" ]
5065fn fail_bounds_check ( file_line : & ( & ' static str , uint ) ,
@@ -65,6 +80,7 @@ pub fn fail_impl(fmt: &fmt::Arguments, file_line: &(&'static str, uint)) -> ! {
6580 #[ allow( ctypes) ]
6681 extern {
6782
83+ // NOTE: remove after next snapshot
6884 #[ cfg( stage0) ]
6985 #[ lang = "begin_unwind" ]
7086 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)) -> ! {
7995 let ( file, line) = * file_line;
8096 unsafe { fail_impl ( fmt, file, line) }
8197}
82-
0 commit comments