16
16
//! interface for failure is:
17
17
//!
18
18
//! ```ignore
19
- //! fn begin_unwind (fmt: &fmt::Arguments, &(&'static str, uint)) -> !;
19
+ //! fn fail_impl (fmt: &fmt::Arguments, &(&'static str, uint)) -> !;
20
20
//! ```
21
21
//!
22
22
//! This definition allows for failing with any general message, but it does not
@@ -39,7 +39,7 @@ fn fail_(expr_file_line: &(&'static str, &'static str, uint)) -> ! {
39
39
let ( expr, file, line) = * expr_file_line;
40
40
let ref file_line = ( file, line) ;
41
41
format_args ! ( |args| -> ( ) {
42
- begin_unwind ( args, file_line) ;
42
+ fail_impl ( args, file_line) ;
43
43
} , "{}" , expr) ;
44
44
45
45
unsafe { intrinsics:: abort ( ) }
@@ -50,33 +50,33 @@ fn fail_(expr_file_line: &(&'static str, &'static str, uint)) -> ! {
50
50
fn fail_bounds_check ( file_line : & ( & ' static str , uint ) ,
51
51
index : uint , len : uint ) -> ! {
52
52
format_args ! ( |args| -> ( ) {
53
- begin_unwind ( args, file_line) ;
53
+ fail_impl ( args, file_line) ;
54
54
} , "index out of bounds: the len is {} but the index is {}" , len, index) ;
55
55
unsafe { intrinsics:: abort ( ) }
56
56
}
57
57
58
58
#[ cold] #[ inline( never) ]
59
- pub fn begin_unwind_string ( msg : & str , file : & ( & ' static str , uint ) ) -> ! {
60
- format_args ! ( |fmt| begin_unwind ( fmt, file) , "{}" , msg)
59
+ pub fn fail_impl_string ( msg : & str , file : & ( & ' static str , uint ) ) -> ! {
60
+ format_args ! ( |fmt| fail_impl ( fmt, file) , "{}" , msg)
61
61
}
62
62
63
63
#[ cold] #[ inline( never) ]
64
- pub fn begin_unwind ( fmt : & fmt:: Arguments , file_line : & ( & ' static str , uint ) ) -> ! {
64
+ pub fn fail_impl ( fmt : & fmt:: Arguments , file_line : & ( & ' static str , uint ) ) -> ! {
65
65
#[ allow( ctypes) ]
66
66
extern {
67
67
68
68
#[ cfg( stage0) ]
69
69
#[ lang = "begin_unwind" ]
70
- fn begin_unwind ( fmt : & fmt:: Arguments , file : & ' static str ,
70
+ fn fail_impl ( fmt : & fmt:: Arguments , file : & ' static str ,
71
71
line : uint ) -> !;
72
72
73
73
#[ cfg( not( stage0) ) ]
74
74
#[ lang = "fail_fmt" ]
75
- fn begin_unwind ( fmt : & fmt:: Arguments , file : & ' static str ,
75
+ fn fail_impl ( fmt : & fmt:: Arguments , file : & ' static str ,
76
76
line : uint ) -> !;
77
77
78
78
}
79
79
let ( file, line) = * file_line;
80
- unsafe { begin_unwind ( fmt, file, line) }
80
+ unsafe { fail_impl ( fmt, file, line) }
81
81
}
82
82
0 commit comments