@@ -34,49 +34,20 @@ use fmt;
34
34
35
35
#[ cold] #[ inline( never) ] // this is the slow path, always
36
36
#[ lang="panic" ]
37
- #[ cfg( stage0) ]
38
- pub fn panic ( expr_file_line : & ( & ' static str , & ' static str , usize ) ) -> ! {
39
- let ( expr, file, line) = * expr_file_line;
40
- panic_fmt ( format_args ! ( "{}" , expr) , & ( file, line) )
41
- }
42
- #[ cold] #[ inline( never) ] // this is the slow path, always
43
- #[ lang="panic" ]
44
- #[ cfg( not( stage0) ) ]
45
37
pub fn panic ( expr_file_line : & ( & ' static str , & ' static str , u32 ) ) -> ! {
46
38
let ( expr, file, line) = * expr_file_line;
47
39
panic_fmt ( format_args ! ( "{}" , expr) , & ( file, line) )
48
40
}
49
41
50
42
#[ cold] #[ inline( never) ]
51
43
#[ lang="panic_bounds_check" ]
52
- #[ cfg( stage0) ]
53
- fn panic_bounds_check ( file_line : & ( & ' static str , usize ) ,
54
- index : usize , len : usize ) -> ! {
55
- panic_fmt ( format_args ! ( "index out of bounds: the len is {} but the index is {}" ,
56
- len, index) , file_line)
57
- }
58
- #[ cold] #[ inline( never) ]
59
- #[ lang="panic_bounds_check" ]
60
- #[ cfg( not( stage0) ) ]
61
44
fn panic_bounds_check ( file_line : & ( & ' static str , u32 ) ,
62
45
index : usize , len : usize ) -> ! {
63
46
panic_fmt ( format_args ! ( "index out of bounds: the len is {} but the index is {}" ,
64
47
len, index) , file_line)
65
48
}
66
49
67
50
#[ cold] #[ inline( never) ]
68
- #[ cfg( stage0) ]
69
- pub fn panic_fmt ( fmt : fmt:: Arguments , file_line : & ( & ' static str , usize ) ) -> ! {
70
- #[ allow( improper_ctypes) ]
71
- extern {
72
- #[ lang = "panic_fmt" ]
73
- fn panic_impl ( fmt : fmt:: Arguments , file : & ' static str , line : uint ) -> !;
74
- }
75
- let ( file, line) = * file_line;
76
- unsafe { panic_impl ( fmt, file, line as uint ) }
77
- }
78
- #[ cold] #[ inline( never) ]
79
- #[ cfg( not( stage0) ) ]
80
51
pub fn panic_fmt ( fmt : fmt:: Arguments , file_line : & ( & ' static str , u32 ) ) -> ! {
81
52
#[ allow( improper_ctypes) ]
82
53
extern {
0 commit comments