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;
77use  crate :: function:: Function ; 
88use  crate :: state:: { callback_error_ext,  ExtraData ,  Lua } ; 
99use  crate :: traits:: { FromLuaMulti ,  IntoLua } ; 
10+ use  crate :: types:: MaybeSend ; 
1011
1112pub  use  require:: { NavigateError ,  Require ,  TextRequirer } ; 
1213
@@ -17,7 +18,7 @@ impl Lua {
1718/// and load modules. 
1819#[ cfg( any( feature = "luau" ,  doc) ) ]  
1920    #[ 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 >  { 
2122        require:: create_require_function ( self ,  require) 
2223    } 
2324
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ type WriteResult = ffi::luarequire_WriteResult;
5353/// A trait for handling modules loading and navigation in the Luau `require-by-string` system. 
5454#[ cfg( any( feature = "luau" ,  doc) ) ]  
5555#[ cfg_attr( docsrs,  doc( cfg( feature = "luau" ) ) ) ]  
56- pub  trait  Require :   MaybeSend  { 
56+ pub  trait  Require  { 
5757    /// Returns `true` if "require" is permitted for the given chunk name. 
5858fn  is_require_allowed ( & self ,  chunk_name :  & str )  -> bool ; 
5959
@@ -517,7 +517,10 @@ unsafe fn write_to_buffer(
517517} 
518518
519519#[ 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 >  { 
521524    unsafe  extern  "C-unwind"  fn  find_current_file ( state :  * mut  ffi:: lua_State )  -> c_int  { 
522525        let  mut  ar:  ffi:: lua_Debug  = mem:: zeroed ( ) ; 
523526        for  level in  2 .. { 
Original file line number Diff line number Diff line change @@ -480,7 +480,7 @@ fn test_too_large_table() -> Result<()> {
480480    let  lua = Lua :: new ( ) ; 
481481
482482    // 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 ) ; 
484484    assert ! ( 
485485        matches!( & result,  Err ( Error :: RuntimeError ( err) )  if  err. contains( "table overflow" )  || err. contains( "memory allocation error" ) ) , 
486486        "expected a runtime error (table overflow), got: {result:?}" , 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments