summaryrefslogtreecommitdiff
path: root/mlua-sys/src/lua54/lua.rs
diff options
context:
space:
mode:
authorAlex Orlenko <zxteam@protonmail.com>2024-01-03 11:31:39 +0000
committerAlex Orlenko <zxteam@protonmail.com>2024-01-03 11:31:39 +0000
commitc0a0983025ae41ab68d194f137ab61f918bb734b (patch)
treef8e6eef7566ad2589b3a7d4717f7f7a0b3b96881 /mlua-sys/src/lua54/lua.rs
parent69ff0c5509e40db0ce4183e8f1f997750e93a3d0 (diff)
downloadmlua-c0a0983025ae41ab68d194f137ab61f918bb734b.zip
mlua-sys: always inline lua_error
Diffstat (limited to 'mlua-sys/src/lua54/lua.rs')
-rw-r--r--mlua-sys/src/lua54/lua.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/mlua-sys/src/lua54/lua.rs b/mlua-sys/src/lua54/lua.rs
index b134866..26ad0a6 100644
--- a/mlua-sys/src/lua54/lua.rs
+++ b/mlua-sys/src/lua54/lua.rs
@@ -159,6 +159,7 @@ extern "C-unwind" {
// lua_rawlen's return type changed from size_t to lua_Unsigned int in Lua 5.4.
// This adapts the crate API to the new Lua ABI.
+#[inline(always)]
pub unsafe fn lua_rawlen(L: *mut lua_State, idx: c_int) -> usize {
lua_rawlen_(L, idx) as usize
}
@@ -359,6 +360,7 @@ extern "C-unwind" {
// lua_error does not return but is declared to return int, and Rust translates
// ! to void which can cause link-time errors if the platform linker is aware
// of return types and requires they match (for example: wasm does this).
+#[inline(always)]
pub unsafe fn lua_error(L: *mut lua_State) -> ! {
lua_error_(L);
unreachable!();