Skip to content

Commit dbfbc25

Browse files
committed
Merge branch 'v0.10' into for/crank
2 parents eb691d1 + 9caf354 commit dbfbc25

File tree

5 files changed

+62
-5
lines changed

5 files changed

+62
-5
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## v0.10.2 (Jan 27th, 2025)
2+
3+
- Set `Default` for `Value` to be `Nil`
4+
- Allow exhaustive match on `Value` (#502)
5+
- Add `Table::set_safeenv` method (Luau)
6+
17
## v0.10.2 (Dec 1st, 2024)
28

39
- Switch proc-macro-error to proc-macro-error2 (#493)

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mlua"
3-
version = "0.10.2" # remember to update mlua_derive
3+
version = "0.10.3" # remember to update mlua_derive
44
authors = ["Aleksandr Orlenko <zxteam@pm.me>", "kyren <catherine@kyju.org>"]
55
rust-version = "1.79.0"
66
edition = "2021"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ Add to `Cargo.toml` :
133133

134134
``` toml
135135
[dependencies]
136-
mlua = { version = "0.10.2", features = ["lua54", "vendored"] }
136+
mlua = { version = "0.10", features = ["lua54", "vendored"] }
137137
```
138138

139139
`main.rs`
@@ -168,7 +168,7 @@ Add to `Cargo.toml` :
168168
crate-type = ["cdylib"]
169169

170170
[dependencies]
171-
mlua = { version = "0.10.2", features = ["lua54", "module"] }
171+
mlua = { version = "0.10", features = ["lua54", "module"] }
172172
```
173173

174174
`lib.rs` :

mlua-sys/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mlua-sys"
3-
version = "0.6.6"
3+
version = "0.6.7"
44
authors = ["Aleksandr Orlenko <zxteam@pm.me>"]
55
rust-version = "1.71"
66
edition = "2021"
@@ -40,7 +40,7 @@ cfg-if = "1.0"
4040
pkg-config = "0.3.17"
4141
lua-src = { version = ">= 547.0.0, < 547.1.0", optional = true }
4242
luajit-src = { version = ">= 210.5.0, < 210.6.0", optional = true }
43-
luau0-src = { version = "0.11.1", optional = true }
43+
luau0-src = { version = "0.12.0", optional = true }
4444

4545
[lints.rust]
4646
unexpected_cfgs = { level = "allow", check-cfg = ['cfg(raw_dylib)'] }

mlua-sys/src/luau/luacode.rs

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//! Contains definitions from `luacode.h`.
22
3+
use std::marker::{PhantomData, PhantomPinned};
34
use std::os::raw::{c_char, c_int, c_void};
45
use std::{ptr, slice};
56

@@ -15,6 +16,10 @@ pub struct lua_CompileOptions {
1516
pub vectorType: *const c_char,
1617
pub mutableGlobals: *const *const c_char,
1718
pub userdataTypes: *const *const c_char,
19+
pub librariesWithKnownMembers: *const *const c_char,
20+
pub libraryMemberTypeCallback: Option<lua_LibraryMemberTypeCallback>,
21+
pub libraryMemberConstantCallback: Option<lua_LibraryMemberConstantCallback>,
22+
pub disabledBuiltins: *const *const c_char,
1823
}
1924

2025
impl Default for lua_CompileOptions {
@@ -29,10 +34,56 @@ impl Default for lua_CompileOptions {
2934
vectorType: ptr::null(),
3035
mutableGlobals: ptr::null(),
3136
userdataTypes: ptr::null(),
37+
librariesWithKnownMembers: ptr::null(),
38+
libraryMemberTypeCallback: None,
39+
libraryMemberConstantCallback: None,
40+
disabledBuiltins: ptr::null(),
3241
}
3342
}
3443
}
3544

45+
#[repr(C)]
46+
pub struct lua_CompileConstant {
47+
_data: [u8; 0],
48+
_marker: PhantomData<(*mut u8, PhantomPinned)>,
49+
}
50+
51+
/// Type table tags
52+
#[doc(hidden)]
53+
#[repr(i32)]
54+
#[non_exhaustive]
55+
pub enum luau_BytecodeType {
56+
Nil = 0,
57+
Boolean,
58+
Number,
59+
String,
60+
Table,
61+
Function,
62+
Thread,
63+
UserData,
64+
Vector,
65+
Buffer,
66+
67+
Any = 15,
68+
}
69+
70+
pub type lua_LibraryMemberTypeCallback =
71+
unsafe extern "C-unwind" fn(library: *const c_char, member: *const c_char) -> c_int;
72+
73+
pub type lua_LibraryMemberConstantCallback = unsafe extern "C-unwind" fn(
74+
library: *const c_char,
75+
member: *const c_char,
76+
constant: *mut lua_CompileConstant,
77+
);
78+
79+
extern "C" {
80+
pub fn luau_set_compile_constant_nil(cons: *mut lua_CompileConstant);
81+
pub fn luau_set_compile_constant_boolean(cons: *mut lua_CompileConstant, b: c_int);
82+
pub fn luau_set_compile_constant_number(cons: *mut lua_CompileConstant, n: f64);
83+
pub fn luau_set_compile_constant_vector(cons: *mut lua_CompileConstant, x: f32, y: f32, z: f32, w: f32);
84+
pub fn luau_set_compile_constant_string(cons: *mut lua_CompileConstant, s: *const c_char, l: usize);
85+
}
86+
3687
extern "C-unwind" {
3788
#[link_name = "luau_compile"]
3889
pub fn luau_compile_(

0 commit comments

Comments
 (0)