diff --git a/src/lib.rs b/src/lib.rs index 608ee525..c2f44a07 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -55,6 +55,7 @@ impl Drop for JsObject { } #[cold] +#[inline(never)] pub fn throw(s: &str) -> ! { extern { fn __wbindgen_throw(a: *const u8, b: usize) -> !; @@ -72,10 +73,16 @@ pub mod __rt { #[inline] pub fn assert_not_null(s: *mut T) { if s.is_null() { - super::throw("null pointer passed to rust"); + throw_null(); } } + #[cold] + #[inline(never)] + fn throw_null() -> ! { + super::throw("null pointer passed to rust"); + } + /// A vendored version of `RefCell` from the standard library. /// /// Now why, you may ask, would we do that? Surely `RefCell` in libstd is