From ce4fc80e18663b211f2533d6fc67b512055abc51 Mon Sep 17 00:00:00 2001 From: Alex Orlenko Date: Sat, 22 Nov 2025 12:58:59 +0000 Subject: [PATCH] Bump luau-src to 0.17.0 (Luau 0.701) --- mlua-sys/Cargo.toml | 2 +- mlua-sys/src/luau/luarequire.rs | 11 +++++++++++ src/luau/require.rs | 1 + 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/mlua-sys/Cargo.toml b/mlua-sys/Cargo.toml index fc61a35..53a414a 100644 --- a/mlua-sys/Cargo.toml +++ b/mlua-sys/Cargo.toml @@ -41,7 +41,7 @@ cfg-if = "1.0" pkg-config = "0.3.17" lua-src = { version = ">= 548.1.0, < 548.2.0", optional = true } luajit-src = { version = ">= 210.6.0, < 210.7.0", optional = true } -luau0-src = { version = "0.16.0", optional = true } +luau0-src = { version = "0.17.0", optional = true } [lints.rust] unexpected_cfgs = { level = "allow", check-cfg = ['cfg(raw_dylib)'] } diff --git a/mlua-sys/src/luau/luarequire.rs b/mlua-sys/src/luau/luarequire.rs index 4a929de..809acc2 100644 --- a/mlua-sys/src/luau/luarequire.rs +++ b/mlua-sys/src/luau/luarequire.rs @@ -58,6 +58,17 @@ pub struct luarequire_Configuration { path: *const c_char, ) -> luarequire_NavigateResult, + // Provides a final override opportunity if an alias cannot be found in configuration files. If + // NAVIGATE_SUCCESS is returned, this must update the internal state to point at the aliased module. + // Can be left undefined. + pub to_alias_fallback: Option< + unsafe extern "C-unwind" fn( + L: *mut lua_State, + ctx: *mut c_void, + alias_unprefixed: *const c_char, + ) -> luarequire_NavigateResult, + >, + // Navigates through the context by making mutations to the internal state. pub to_parent: unsafe extern "C-unwind" fn(L: *mut lua_State, ctx: *mut c_void) -> luarequire_NavigateResult, diff --git a/src/luau/require.rs b/src/luau/require.rs index 94d5c76..13e968b 100644 --- a/src/luau/require.rs +++ b/src/luau/require.rs @@ -299,6 +299,7 @@ pub(super) unsafe extern "C-unwind" fn init_config(config: *mut ffi::luarequire_ (*config).is_require_allowed = is_require_allowed; (*config).reset = reset; (*config).jump_to_alias = jump_to_alias; + (*config).to_alias_fallback = None; (*config).to_parent = to_parent; (*config).to_child = to_child; (*config).is_module_present = is_module_present;