File tree Expand file tree Collapse file tree 3 files changed +13
-6
lines changed Expand file tree Collapse file tree 3 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,8 @@ static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;
65
65
// This translates into an `unreachable` instruction that will
66
66
// raise a `trap` the WebAssembly execution if we panic at runtime.
67
67
#[panic_implementation]
68
- fn panic (_info : & :: core :: panic :: PanicInfo ) -> ! {
68
+ #[no_mangle]
69
+ pub fn panic (_info : & :: core :: panic :: PanicInfo ) -> ! {
69
70
unsafe {
70
71
:: core :: intrinsics :: abort ();
71
72
}
@@ -74,7 +75,8 @@ fn panic(_info: &::core::panic::PanicInfo) -> ! {
74
75
// Need to provide a tiny `oom` lang-item implementation for
75
76
// `#![no_std]`.
76
77
#[lang = " oom" ]
77
- extern " C" fn oom () -> ! {
78
+ #[no_mangle]
79
+ pub extern " C" fn oom () -> ! {
78
80
unsafe {
79
81
:: core :: intrinsics :: abort ();
80
82
}
Original file line number Diff line number Diff line change @@ -19,7 +19,8 @@ static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;
19
19
// This translates into an `unreachable` instruction that will
20
20
// raise a `trap` the WebAssembly execution if we panic at runtime.
21
21
#[ panic_implementation]
22
- fn panic ( _info : & :: core:: panic:: PanicInfo ) -> ! {
22
+ #[ no_mangle]
23
+ pub fn panic ( _info : & :: core:: panic:: PanicInfo ) -> ! {
23
24
unsafe {
24
25
:: core:: intrinsics:: abort ( ) ;
25
26
}
@@ -28,14 +29,16 @@ fn panic(_info: &::core::panic::PanicInfo) -> ! {
28
29
// Need to provide a tiny `oom` lang-item implementation for
29
30
// `#![no_std]`.
30
31
#[ lang = "oom" ]
31
- extern "C" fn oom ( ) -> ! {
32
+ #[ no_mangle]
33
+ pub extern "C" fn oom ( ) -> ! {
32
34
unsafe {
33
35
:: core:: intrinsics:: abort ( ) ;
34
36
}
35
37
}
36
38
37
39
// Needed for non-wasm targets.
38
40
#[ lang = "eh_personality" ]
41
+ #[ no_mangle]
39
42
pub extern "C" fn eh_personality ( ) { }
40
43
41
44
// Now, use the allocator via `alloc` types! ///////////////////////////////////
Original file line number Diff line number Diff line change @@ -65,7 +65,8 @@ static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;
65
65
// This translates into an `unreachable` instruction that will
66
66
// raise a `trap` the WebAssembly execution if we panic at runtime.
67
67
#[panic_implementation]
68
- fn panic(_info: &::core::panic::PanicInfo) -> ! {
68
+ #[no_mangle]
69
+ pub fn panic(_info: &::core::panic::PanicInfo) -> ! {
69
70
unsafe {
70
71
::core::intrinsics::abort();
71
72
}
@@ -74,7 +75,8 @@ fn panic(_info: &::core::panic::PanicInfo) -> ! {
74
75
// Need to provide a tiny `oom` lang-item implementation for
75
76
// `#![no_std]`.
76
77
#[lang = "oom"]
77
- extern "C" fn oom() -> ! {
78
+ #[no_mangle]
79
+ pub extern "C" fn oom() -> ! {
78
80
unsafe {
79
81
::core::intrinsics::abort();
80
82
}
You can’t perform that action at this time.
0 commit comments