File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ use crate::error::Result;
7
7
use crate :: function:: Function ;
8
8
use crate :: state:: { callback_error_ext, ExtraData , Lua } ;
9
9
use crate :: traits:: { FromLuaMulti , IntoLua } ;
10
+ use crate :: types:: MaybeSend ;
10
11
11
12
pub use require:: { NavigateError , Require , TextRequirer } ;
12
13
@@ -17,7 +18,7 @@ impl Lua {
17
18
/// and load modules.
18
19
#[ cfg( any( feature = "luau" , doc) ) ]
19
20
#[ cfg_attr( docsrs, doc( cfg( feature = "luau" ) ) ) ]
20
- pub fn create_require_function < R : Require + ' static > ( & self , require : R ) -> Result < Function > {
21
+ pub fn create_require_function < R : Require + MaybeSend + ' static > ( & self , require : R ) -> Result < Function > {
21
22
require:: create_require_function ( self , require)
22
23
}
23
24
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ type WriteResult = ffi::luarequire_WriteResult;
53
53
/// A trait for handling modules loading and navigation in the Luau `require-by-string` system.
54
54
#[ cfg( any( feature = "luau" , doc) ) ]
55
55
#[ cfg_attr( docsrs, doc( cfg( feature = "luau" ) ) ) ]
56
- pub trait Require : MaybeSend {
56
+ pub trait Require {
57
57
/// Returns `true` if "require" is permitted for the given chunk name.
58
58
fn is_require_allowed ( & self , chunk_name : & str ) -> bool ;
59
59
@@ -517,7 +517,10 @@ unsafe fn write_to_buffer(
517
517
}
518
518
519
519
#[ cfg( feature = "luau" ) ]
520
- pub ( super ) fn create_require_function < R : Require + ' static > ( lua : & Lua , require : R ) -> Result < Function > {
520
+ pub ( super ) fn create_require_function < R : Require + MaybeSend + ' static > (
521
+ lua : & Lua ,
522
+ require : R ,
523
+ ) -> Result < Function > {
521
524
unsafe extern "C-unwind" fn find_current_file ( state : * mut ffi:: lua_State ) -> c_int {
522
525
let mut ar: ffi:: lua_Debug = mem:: zeroed ( ) ;
523
526
for level in 2 .. {
Original file line number Diff line number Diff line change @@ -480,7 +480,7 @@ fn test_too_large_table() -> Result<()> {
480
480
let lua = Lua :: new ( ) ;
481
481
482
482
// Test creating a too large table
483
- let result = lua. create_table_with_capacity ( 1 << 31 , 1 << 27 ) ;
483
+ let result = lua. create_table_with_capacity ( 1 << 32 , 1 << 27 ) ;
484
484
assert ! (
485
485
matches!( & result, Err ( Error :: RuntimeError ( err) ) if err. contains( "table overflow" ) || err. contains( "memory allocation error" ) ) ,
486
486
"expected a runtime error (table overflow), got: {result:?}" ,
You can’t perform that action at this time.
0 commit comments