Skip to content

Commit 2390077

Browse files
committed
Move to miri.rs and re-export it
1 parent 72b555c commit 2390077

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/libpanic_unwind/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ cfg_if::cfg_if! {
3939
if #[cfg(miri)] {
4040
#[path = "miri.rs"]
4141
mod imp;
42+
// Export this at the root of the crate so that Miri
43+
// has a stable palce to look it up
44+
pub use imp::miri_panic_trampoline;
4245
} else if #[cfg(target_os = "emscripten")] {
4346
#[path = "emcc.rs"]
4447
mod imp;
@@ -98,7 +101,4 @@ pub unsafe extern "C" fn __rust_start_panic(payload: usize) -> u32 {
98101
imp::panic(Box::from_raw((*payload).box_me_up()))
99102
}
100103

101-
// A dummy helper function for Miri.
102-
// Used to push an empty stack frame when we start unwinding
103-
#[cfg(miri)]
104-
pub fn miri_panic_trampoline() {}
104+

src/libpanic_unwind/miri.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,8 @@ pub unsafe fn cleanup(ptr: *mut u8) -> Box<dyn Any + Send> {
2121
fn rust_eh_personality() {
2222
unsafe { core::intrinsics::abort() }
2323
}
24+
25+
// A dummy helper function for Miri.
26+
// Used to push an empty stack frame when we start unwinding
27+
#[cfg(miri)]
28+
pub fn miri_panic_trampoline() {}

0 commit comments

Comments
 (0)