File tree Expand file tree Collapse file tree 4 files changed +29
-6
lines changed
crates/panic-implementation Expand file tree Collapse file tree 4 files changed +29
-6
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,9 @@ test = false
99[build-dependencies ]
1010cc = { optional = true , version = " 1.0" }
1111
12+ [dev-dependencies ]
13+ panic-implementation = { path = ' crates/panic-implementation' }
14+
1215[features ]
1316default = [" compiler-builtins" ]
1417
Original file line number Diff line number Diff line change 1+ [package ]
2+ name = " panic-implementation"
3+ version = " 0.1.0"
4+ authors = [
" Alex Crichton <[email protected] >" ]
5+
6+ [dependencies ]
Original file line number Diff line number Diff line change 1+ // Hack of a crate until rust-lang/rust#51647 is fixed
2+
3+ #![ feature( no_core, panic_implementation) ]
4+ #![ no_core]
5+
6+ extern crate core;
7+
8+ #[ panic_implementation]
9+ fn panic ( _: & core:: panic:: PanicInfo ) -> ! {
10+ loop { }
11+ }
Original file line number Diff line number Diff line change 1212#![ feature( core_float) ]
1313#![ feature( lang_items) ]
1414#![ feature( start) ]
15- #![ feature( global_allocator) ]
1615#![ feature( allocator_api) ]
1716#![ feature( panic_implementation) ]
1817#![ cfg_attr( windows, feature( panic_unwind) ) ]
1918#![ no_std]
2019
20+ extern crate panic_implementation;
21+
2122#[ cfg( not( thumb) ) ]
2223#[ link( name = "c" ) ]
2324extern { }
@@ -393,6 +394,13 @@ fn run() {
393394 bb ( modti3 ( bb ( 2 ) , bb ( 2 ) ) ) ;
394395
395396 something_with_a_dtor ( & || assert_eq ! ( bb( 1 ) , 1 ) ) ;
397+
398+ extern {
399+ fn rust_begin_unwind ( ) ;
400+ }
401+ // if bb(false) {
402+ unsafe { rust_begin_unwind ( ) ; }
403+ // }
396404}
397405
398406fn something_with_a_dtor ( f : & Fn ( ) ) {
@@ -442,8 +450,3 @@ pub fn _Unwind_Resume() {}
442450#[ lang = "eh_personality" ]
443451#[ no_mangle]
444452pub extern "C" fn eh_personality ( ) { }
445-
446- #[ panic_implementation]
447- fn panic ( x : & core:: panic:: PanicInfo ) -> ! {
448- loop { }
449- }
You can’t perform that action at this time.
0 commit comments