MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / get_panic_string

Function get_panic_string

cranelift/src/bugpoint.rs:917–928  ·  view source on GitHub ↗
(panic: Box<dyn std::any::Any>)

Source from the content-addressed store, hash-verified

915}
916
917fn get_panic_string(panic: Box<dyn std::any::Any>) -> String {
918 let panic = match panic.downcast::<&'static str>() {
919 Ok(panic_msg) => {
920 return panic_msg.to_string();
921 }
922 Err(panic) => panic,
923 };
924 match panic.downcast::<String>() {
925 Ok(panic_msg) => *panic_msg,
926 Err(_) => "Box<Any>".to_string(),
927 }
928}
929
930enum CheckResult {
931 /// The function compiled fine, or the verifier noticed an error.

Callers 1

check_for_crashMethod · 0.85

Calls 1

to_stringMethod · 0.45

Tested by

no test coverage detected