Skip to content

Commit fd602be

Browse files
authored
Lua 5.5 support (#24)
* fix: Use Lua 5.5 compatible for loop syntax * feat: Add Lua 5.5 to feature handling passed to mlua
1 parent fc656b0 commit fd602be

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/luarocks/build/rust-mlua.lua

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ function mlua.run(rockspec, no_install)
1616
local lua_version = cfg.lua_version
1717

1818
-- Activate features depending on Lua version
19-
if lua_version == "5.4" then
19+
if lua_version == "5.5" then
20+
table.insert(features, "lua55")
21+
elseif lua_version == "5.4" then
2022
table.insert(features, "lua54")
2123
elseif lua_version == "5.3" then
2224
table.insert(features, "lua53")
@@ -73,6 +75,9 @@ function mlua.run(rockspec, no_install)
7375

7476
fs.make_dir(dir.dir_name(libdir))
7577
for mod, rustlib_name in pairs(rockspec.build.modules) do
78+
-- Make loop variable mutable in Lua 5.5
79+
local mod
80+
7681
-- If `mod` is a number, then it's an array entry
7782
if type(mod) == "number" then
7883
mod = rustlib_name

0 commit comments

Comments
 (0)