33
33
use fmt;
34
34
use intrinsics;
35
35
36
- #[ cfg( stage0) ]
37
36
#[ cold] #[ inline( never) ] // this is the slow path, always
38
37
#[ lang="fail_" ]
39
38
fn fail_ ( expr : & ' static str , file : & ' static str , line : uint ) -> ! {
@@ -44,7 +43,6 @@ fn fail_(expr: &'static str, file: &'static str, line: uint) -> ! {
44
43
unsafe { intrinsics:: abort ( ) }
45
44
}
46
45
47
- #[ cfg( stage0) ]
48
46
#[ cold]
49
47
#[ lang="fail_bounds_check" ]
50
48
fn fail_bounds_check ( file : & ' static str , line : uint ,
@@ -55,7 +53,6 @@ fn fail_bounds_check(file: &'static str, line: uint,
55
53
unsafe { intrinsics:: abort ( ) }
56
54
}
57
55
58
- #[ cfg( stage0) ]
59
56
#[ cold]
60
57
pub fn begin_unwind ( fmt : & fmt:: Arguments , file_line : & ( & ' static str , uint ) ) -> ! {
61
58
#[ allow( ctypes) ]
@@ -68,37 +65,3 @@ pub fn begin_unwind(fmt: &fmt::Arguments, file_line: &(&'static str, uint)) -> !
68
65
unsafe { begin_unwind ( fmt, file, line) }
69
66
}
70
67
71
- #[ cfg( not( stage0) ) ]
72
- #[ cold] #[ inline( never) ] // this is the slow path, always
73
- #[ lang="fail_" ]
74
- fn fail_ ( expr : & ' static str , file : & ' static str , line : uint ) -> ! {
75
- format_args ! ( |args| -> ( ) {
76
- begin_unwind( args, & ( file, line) ) ;
77
- } , "{}" , expr) ;
78
-
79
- unsafe { intrinsics:: abort ( ) }
80
- }
81
-
82
- #[ cfg( not( stage0) ) ]
83
- #[ cold]
84
- #[ lang="fail_bounds_check" ]
85
- fn fail_bounds_check ( file : & ' static str , line : uint ,
86
- index : uint , len : uint ) -> ! {
87
- format_args ! ( |args| -> ( ) {
88
- begin_unwind( args, & ( file, line) ) ;
89
- } , "index out of bounds: the len is {} but the index is {}" , len, index) ;
90
- unsafe { intrinsics:: abort ( ) }
91
- }
92
-
93
- #[ cfg( not( stage0) ) ]
94
- #[ cold]
95
- pub fn begin_unwind ( fmt : & fmt:: Arguments , file_line : & ( & ' static str , uint ) ) -> ! {
96
- #[ allow( ctypes) ]
97
- extern {
98
- #[ lang = "begin_unwind" ]
99
- fn begin_unwind ( fmt : & fmt:: Arguments , file_line : & ' static str ,
100
- line : uint ) -> !;
101
- }
102
- let ( file, line) = * file_line;
103
- unsafe { begin_unwind ( fmt, file, line) }
104
- }
0 commit comments