浏览代码

Show ld.so expect message

Jeremy Soller 3 年之前
父节点
当前提交
dbaeb8f067
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/ld_so/mod.rs

+ 2 - 2
src/ld_so/mod.rs

@@ -47,7 +47,7 @@ impl<T, E: core::fmt::Debug> ExpectTlsFree for Result<T, E> {
     fn expect_notls(self, msg: &str) -> T {
         match self {
             Ok(t) => t,
-            Err(err) => panic_notls(format_args!("expect failed for Result with err: {:?}", err)),
+            Err(err) => panic_notls(format_args!("{}: expect failed for Result with err: {:?}", msg, err)),
         }
     }
 }
@@ -57,7 +57,7 @@ impl<T> ExpectTlsFree for Option<T> {
     fn expect_notls(self, msg: &str) -> T {
         match self {
             Some(t) => t,
-            None => panic_notls("expect failed for Option"),
+            None => panic_notls(format_args!("{}: expect failed for Option", msg)),
         }
     }
 }