1924 Commits

Author SHA1 Message Date
Alex Orlenko 0711c614c7 v0.12.0-rc.2 v0.12.0-rc.2 2026-06-06 14:28:31 +01:00
Alex Orlenko 743325f7d6 clippy 2026-06-06 14:28:31 +01:00
Alex Orlenko 0b365e92a9 Support to_alias_override/to_alias_fallback in Require trait (Luau) 2026-06-06 14:11:59 +01:00
Alex Orlenko 15fb63b2a2 Support thread create/resume/yield callbacks for all Lua/Luau versions
Introduce new `Lua::set_thread_event_callback` function to register callback for
thread events.
Thread collection callback is removed as unlikely very usefil and has too many limitations.
2026-06-01 00:25:12 +01:00
Alex Orlenko 0849d05c83 mlua_derive: Update docs 2026-05-31 13:45:48 +01:00
Alex Orlenko 38c05b850e mlua_derive: Improve error reporting for #[lua] attributes 2026-05-31 13:32:33 +01:00
Alex Orlenko 8d1841f8cf Fix tests (Luau 0.723 integer type) 2026-05-31 13:22:50 +01:00
Alex Orlenko e9271d2e32 mlua_derive: Use correct Span in metamethod name validation error 2026-05-31 13:17:40 +01:00
Alex Orlenko e263220fb3 Add documentation for #derive(UserData) 2026-05-31 13:05:03 +01:00
Alex Orlenko e6d16815d7 mlua_derive: Improve context-aware validation for #[lua] attr 2026-05-31 12:56:15 +01:00
Alex Orlenko ae88e8acf8 mlua_derive: Detect (and reject) all generic type parameters in UserData derive 2026-05-31 12:31:35 +01:00
Alex Orlenko fcab60bac4 mlua_derive: Fix #[lua(meta, field)] case 2026-05-31 12:28:06 +01:00
Alex Orlenko 208a70f407 Move inlined #[lua_module] proc macro doc to docs/lua_module.md 2026-05-31 11:17:51 +01:00
Alex Orlenko ca360f9019 Move inlined chunk! macro doc to docs/chunk.md 2026-05-31 11:16:40 +01:00
Alex Orlenko a7c5a24a7b mlua_derive: Deny #[lua = "..."] syntax 2026-05-30 22:23:03 +01:00
Alex Orlenko b7c98ad9bb mlua_derive: Switch from #[userdata] to [derive(UserData)] 2026-05-30 13:11:26 +01:00
Alex Orlenko 1f3dafa564 mlua_derive: Reject static field functions with args 2026-05-30 12:46:31 +01:00
Alex Orlenko 1d4a756436 mlua_derive: Support async userdata methods in macro 2026-05-29 00:56:33 +01:00
Alex Orlenko 6e7d6c78ed mlua_derive: Group functionality in modules
Create new `chunk`, `userdata`, `module` modules.
2026-05-26 23:23:09 +01:00
Alex Orlenko 023e4c61d8 mlua_derive: Fix compilation / remove "if let" guards 2026-05-26 23:23:09 +01:00
Alex Orlenko 92bd06d3c1 mlua_derive: Refactor Capture implementation for chunk! 2026-05-26 23:23:09 +01:00
Alex Orlenko d8544bf038 mlua_derive: Optimize Captures::add 2026-05-26 23:23:09 +01:00
Alex Orlenko 7114c03489 mlua_derive: Remove unneeded Span::line hack for chunk! since we use Rust 1.95+ 2026-05-26 23:23:09 +01:00
Alex Orlenko f4cacc524e mlua_derive: Bump MSRV to 1.88 2026-05-26 23:23:09 +01:00
Alex Orlenko cc7f7ce7b7 mlua_derive: show better error message when $ is not followed by ident 2026-05-26 23:23:09 +01:00
Alex Orlenko 72de602ec3 Fix modules compilation after switching to 2024 edition in mlua_derive 2026-05-26 23:23:09 +01:00
Alex Orlenko 1573dd1242 Add #[mlua::userdata] and #[mlua::userdata_impl] macros 2026-05-26 23:23:09 +01:00
Alex Orlenko 39d3201848 Prevent XRc overflow when dropping RawLua with foreign Lua state
Calling `lua_close` triggers GC collection of the `ExtraData` that
cascades to `RawLua::drop` where extra is already decremented to 0,
causing a subtraction overflow.
2026-05-26 23:18:24 +01:00
莯凛 4aa6214b45 feat: implement Not for StdLib (#699) 2026-04-30 22:56:50 +01:00
Alex Orlenko 72824a468a Remove custom PartialEq for LuaString and use derived one
Lua can compare strings using `lua_rawequal` and it's more efficient
than always compare bytes.
Under the hood Lua compare pointers for interned strings and content for long ones.
Close #694
2026-04-22 22:30:45 +01:00
Alex Orlenko c54b90623c Fix String::to_pointer return NULL in Lua <5.4
Lua 5.4+ can return string pointer when calling `lua_topointer`.
In earlier Lua versions this API always returns NULL.
Let's unify this behavior.
2026-04-22 22:23:25 +01:00
Alex Orlenko 5f0e06fb66 Update CHANGELOG v0.12.0-rc.1 2026-04-22 00:06:11 +01:00
Alex Orlenko 181c9d07b7 v0.12.0-rc.1 2026-04-20 00:24:58 +01:00
Alex Orlenko 4e827179d1 Update compile tests messages 2026-04-20 00:19:56 +01:00
Alex Orlenko cc26dcd4ff Bump rustyline 2026-04-20 00:16:34 +01:00
Alex Orlenko 201e30bc07 Add UserDataOwned<T> wrapper to take ownership of userdata T
It implements `FromLua` and takes ownership of a Lua userdata value.
The semantics is similar to `AnyUserData::take`, preventing any
further use from Lua.

Closes #686
2026-04-20 00:05:57 +01:00
Alex Orlenko 4e028d8409 Change AnyUserData::type_name to return LuaString instead.
This avoids unnecessary allocation and returns type name as it stored in metatable.
2026-04-19 23:26:24 +01:00
Alex Orlenko 3d1ae981d3 Update docs 2026-04-19 22:12:17 +01:00
Alex Orlenko 8c93948f2f Fix tests 2026-04-18 16:13:23 +01:00
Alex Orlenko f2b5cc44de traits module no longer need to be public
The LuaNativeFn traits were moved to the `function` module and all other traits
as re-exported.
2026-04-18 16:09:17 +01:00
Alex Orlenko 27f91dfd1b Accept any error in Function::wrap/wrap_mut/wrap_async
Previously wrapped functions were required to return `mlua::Result`.
Now it's possible to wrap functions returning any errors as long as
they implement `std::error::Error`.

Existing code remains compatible with `mlua::Result` as this type
is not converted to an external error.
2026-04-18 16:01:35 +01:00
Alex Orlenko 75ff11f795 Move LuaNativeFn/Mut into function module 2026-04-18 14:56:24 +01:00
Alex Orlenko df6097ab38 Mark Luau CompileConstant as non_exhaustive 2026-04-18 14:51:54 +01:00
Alex Orlenko 65bb6279ee Update serde types visibility 2026-04-18 14:47:26 +01:00
Alex Orlenko 31b88e85bb cargo fmt 2026-04-18 13:26:42 +01:00
Alex Orlenko 3be4745190 Add initial Luau integer64 type support
RFC: https://rfcs.luau.org/type-long-integer.html
Unfortunately this type is not backward compatible with regular numbers
and require a special "integer" library.
It's not integrated with `Value` enum to keep it simple.
2026-04-18 13:14:05 +01:00
Alex Orlenko c52deec988 Use c_int for userdata metatable id 2026-04-18 13:14:05 +01:00
三咲雅 misaki masa 3ab3c997b3 feat: support external strings for Cow<str> and Cow<CStr> (#692) 2026-04-09 10:45:15 +01:00
Alex Orlenko 5872ed70f5 Make traits module public 2026-04-04 15:04:00 +01:00
Alex Orlenko e7e92b4f6f Make chunk module public 2026-04-03 13:58:05 +01:00