File tree 4 files changed +29
-6
lines changed
crates/panic-implementation
4 files changed +29
-6
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,9 @@ test = false
9
9
[build-dependencies ]
10
10
cc = { optional = true , version = " 1.0" }
11
11
12
+ [dev-dependencies ]
13
+ panic-implementation = { path = ' crates/panic-implementation' }
14
+
12
15
[features ]
13
16
default = [" compiler-builtins" ]
14
17
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 12
12
#![ feature( core_float) ]
13
13
#![ feature( lang_items) ]
14
14
#![ feature( start) ]
15
- #![ feature( global_allocator) ]
16
15
#![ feature( allocator_api) ]
17
16
#![ feature( panic_implementation) ]
18
17
#![ cfg_attr( windows, feature( panic_unwind) ) ]
19
18
#![ no_std]
20
19
20
+ extern crate panic_implementation;
21
+
21
22
#[ cfg( not( thumb) ) ]
22
23
#[ link( name = "c" ) ]
23
24
extern { }
@@ -393,6 +394,13 @@ fn run() {
393
394
bb ( modti3 ( bb ( 2 ) , bb ( 2 ) ) ) ;
394
395
395
396
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
+ // }
396
404
}
397
405
398
406
fn something_with_a_dtor ( f : & Fn ( ) ) {
@@ -442,8 +450,3 @@ pub fn _Unwind_Resume() {}
442
450
#[ lang = "eh_personality" ]
443
451
#[ no_mangle]
444
452
pub 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