File tree Expand file tree Collapse file tree 3 files changed +21
-1
lines changed Expand file tree Collapse file tree 3 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -1348,6 +1348,11 @@ extern "rust-intrinsic" {
1348
1348
/// See documentation of `<*const T>::offset_from` for details.
1349
1349
#[ cfg( not( bootstrap) ) ]
1350
1350
pub fn ptr_offset_from < T > ( ptr : * const T , base : * const T ) -> isize ;
1351
+
1352
+ /// Internal hook used by Miri to implement unwinding.
1353
+ /// Perma-unstable: do not use
1354
+ #[ cfg( not( bootstrap) ) ]
1355
+ pub fn miri_start_panic ( data : * mut ( dyn crate :: any:: Any + Send ) ) -> !;
1351
1356
}
1352
1357
1353
1358
// Some functions are defined here because they accidentally got made
Original file line number Diff line number Diff line change @@ -36,7 +36,10 @@ use core::raw;
36
36
use core:: panic:: BoxMeUp ;
37
37
38
38
cfg_if:: cfg_if! {
39
- if #[ cfg( target_os = "emscripten" ) ] {
39
+ if #[ cfg( miri) ] {
40
+ #[ path = "miri.rs" ]
41
+ mod imp;
42
+ } else if #[ cfg( target_os = "emscripten" ) ] {
40
43
#[ path = "emcc.rs" ]
41
44
mod imp;
42
45
} else if #[ cfg( target_arch = "wasm32" ) ] {
Original file line number Diff line number Diff line change
1
+ pub fn payload ( ) -> * mut u8 {
2
+ core:: ptr:: null_mut ( )
3
+ }
4
+
5
+ pub unsafe fn panic ( data : Box < dyn Any + Send > ) -> u32 {
6
+ core:: intrinsics:: miri_start_panic ( Box :: into_raw ( data) )
7
+ }
8
+
9
+ pub unsafe fn cleanup ( ptr : * mut u8 ) -> Box < dyn Any + Send > {
10
+ Box :: from_raw ( ptr)
11
+ }
12
+
You can’t perform that action at this time.
0 commit comments