@@ -132,7 +132,7 @@ impl<'a, T: 'static> UserDataRegistry<'a, T> {
132132 where
133133 M : Fn ( & ' a Lua , & ' a T , A ) -> MR + MaybeSend + ' static ,
134134 A : FromLuaMulti ,
135- MR : Future < Output = Result < R > > + ' a ,
135+ MR : Future < Output = Result < R > > + MaybeSend + ' a ,
136136 R : IntoLuaMulti ,
137137 {
138138 let name = get_function_name :: < T > ( name) ;
@@ -145,15 +145,14 @@ impl<'a, T: 'static> UserDataRegistry<'a, T> {
145145 } ;
146146 }
147147
148- Box :: new ( move |rawlua , mut args| unsafe {
148+ Box :: new ( move |lua , mut args| unsafe {
149149 let this = args
150150 . pop_front ( )
151151 . ok_or_else ( || Error :: from_lua_conversion ( "missing argument" , "userdata" , None ) ) ;
152- let lua = rawlua. lua ( ) ;
153152 let this = try_self_arg ! ( AnyUserData :: from_lua( try_self_arg!( this) , lua) ) ;
154153 let args = A :: from_lua_args ( args, 2 , Some ( & name) , lua) ;
155154
156- let ( ref_thread, index) = ( rawlua . ref_thread ( ) , this. 0 . index ) ;
155+ let ( ref_thread, index) = ( lua . raw_lua ( ) . ref_thread ( ) , this. 0 . index ) ;
157156 match try_self_arg ! ( this. type_id( ) ) {
158157 Some ( id) if id == TypeId :: of :: < T > ( ) => {
159158 let ud = try_self_arg ! ( borrow_userdata_ref:: <T >( ref_thread, index) ) ;
@@ -162,7 +161,7 @@ impl<'a, T: 'static> UserDataRegistry<'a, T> {
162161 Err ( e) => return Box :: pin ( future:: ready ( Err ( e) ) ) ,
163162 } ;
164163 let fut = method ( lua, ud. get_ref ( ) , args) ;
165- Box :: pin ( async move { fut. await ?. push_into_stack_multi ( rawlua ) } )
164+ Box :: pin ( async move { fut. await ?. push_into_stack_multi ( lua . raw_lua ( ) ) } )
166165 }
167166 _ => {
168167 let err = Error :: bad_self_argument ( & name, Error :: UserDataTypeMismatch ) ;
@@ -177,7 +176,7 @@ impl<'a, T: 'static> UserDataRegistry<'a, T> {
177176 where
178177 M : Fn ( & ' a Lua , & ' a mut T , A ) -> MR + MaybeSend + ' static ,
179178 A : FromLuaMulti ,
180- MR : Future < Output = Result < R > > + ' a ,
179+ MR : Future < Output = Result < R > > + MaybeSend + ' a ,
181180 R : IntoLuaMulti ,
182181 {
183182 let name = get_function_name :: < T > ( name) ;
@@ -190,15 +189,14 @@ impl<'a, T: 'static> UserDataRegistry<'a, T> {
190189 } ;
191190 }
192191
193- Box :: new ( move |rawlua , mut args| unsafe {
192+ Box :: new ( move |lua , mut args| unsafe {
194193 let this = args
195194 . pop_front ( )
196195 . ok_or_else ( || Error :: from_lua_conversion ( "missing argument" , "userdata" , None ) ) ;
197- let lua = rawlua. lua ( ) ;
198196 let this = try_self_arg ! ( AnyUserData :: from_lua( try_self_arg!( this) , lua) ) ;
199197 let args = A :: from_lua_args ( args, 2 , Some ( & name) , lua) ;
200198
201- let ( ref_thread, index) = ( rawlua . ref_thread ( ) , this. 0 . index ) ;
199+ let ( ref_thread, index) = ( lua . raw_lua ( ) . ref_thread ( ) , this. 0 . index ) ;
202200 match try_self_arg ! ( this. type_id( ) ) {
203201 Some ( id) if id == TypeId :: of :: < T > ( ) => {
204202 let mut ud = try_self_arg ! ( borrow_userdata_mut:: <T >( ref_thread, index) ) ;
@@ -207,7 +205,7 @@ impl<'a, T: 'static> UserDataRegistry<'a, T> {
207205 Err ( e) => return Box :: pin ( future:: ready ( Err ( e) ) ) ,
208206 } ;
209207 let fut = method ( lua, ud. get_mut ( ) , args) ;
210- Box :: pin ( async move { fut. await ?. push_into_stack_multi ( rawlua ) } )
208+ Box :: pin ( async move { fut. await ?. push_into_stack_multi ( lua . raw_lua ( ) ) } )
211209 }
212210 _ => {
213211 let err = Error :: bad_self_argument ( & name, Error :: UserDataTypeMismatch ) ;
@@ -252,18 +250,17 @@ impl<'a, T: 'static> UserDataRegistry<'a, T> {
252250 where
253251 F : Fn ( & ' a Lua , A ) -> FR + MaybeSend + ' static ,
254252 A : FromLuaMulti ,
255- FR : Future < Output = Result < R > > + ' a ,
253+ FR : Future < Output = Result < R > > + MaybeSend + ' a ,
256254 R : IntoLuaMulti ,
257255 {
258256 let name = get_function_name :: < T > ( name) ;
259- Box :: new ( move |rawlua, args| unsafe {
260- let lua = rawlua. lua ( ) ;
257+ Box :: new ( move |lua, args| unsafe {
261258 let args = match A :: from_lua_args ( args, 1 , Some ( & name) , lua) {
262259 Ok ( args) => args,
263260 Err ( e) => return Box :: pin ( future:: ready ( Err ( e) ) ) ,
264261 } ;
265262 let fut = function ( lua, args) ;
266- Box :: pin ( async move { fut. await ?. push_into_stack_multi ( rawlua ) } )
263+ Box :: pin ( async move { fut. await ?. push_into_stack_multi ( lua . raw_lua ( ) ) } )
267264 } )
268265 }
269266
@@ -397,7 +394,7 @@ impl<'a, T: 'static> UserDataMethods<'a, T> for UserDataRegistry<'a, T> {
397394 where
398395 M : Fn ( & ' a Lua , & ' a T , A ) -> MR + MaybeSend + ' static ,
399396 A : FromLuaMulti ,
400- MR : Future < Output = Result < R > > + ' a ,
397+ MR : Future < Output = Result < R > > + MaybeSend + ' a ,
401398 R : IntoLuaMulti ,
402399 {
403400 let name = name. to_string ( ) ;
@@ -410,7 +407,7 @@ impl<'a, T: 'static> UserDataMethods<'a, T> for UserDataRegistry<'a, T> {
410407 where
411408 M : Fn ( & ' a Lua , & ' a mut T , A ) -> MR + MaybeSend + ' static ,
412409 A : FromLuaMulti ,
413- MR : Future < Output = Result < R > > + ' a ,
410+ MR : Future < Output = Result < R > > + MaybeSend + ' a ,
414411 R : IntoLuaMulti ,
415412 {
416413 let name = name. to_string ( ) ;
@@ -445,7 +442,7 @@ impl<'a, T: 'static> UserDataMethods<'a, T> for UserDataRegistry<'a, T> {
445442 where
446443 F : Fn ( & ' a Lua , A ) -> FR + MaybeSend + ' static ,
447444 A : FromLuaMulti ,
448- FR : Future < Output = Result < R > > + ' a ,
445+ FR : Future < Output = Result < R > > + MaybeSend + ' a ,
449446 R : IntoLuaMulti ,
450447 {
451448 let name = name. to_string ( ) ;
@@ -480,7 +477,7 @@ impl<'a, T: 'static> UserDataMethods<'a, T> for UserDataRegistry<'a, T> {
480477 where
481478 M : Fn ( & ' a Lua , & ' a T , A ) -> MR + MaybeSend + ' static ,
482479 A : FromLuaMulti ,
483- MR : Future < Output = Result < R > > + ' a ,
480+ MR : Future < Output = Result < R > > + MaybeSend + ' a ,
484481 R : IntoLuaMulti ,
485482 {
486483 let name = name. to_string ( ) ;
@@ -493,7 +490,7 @@ impl<'a, T: 'static> UserDataMethods<'a, T> for UserDataRegistry<'a, T> {
493490 where
494491 M : Fn ( & ' a Lua , & ' a mut T , A ) -> MR + MaybeSend + ' static ,
495492 A : FromLuaMulti ,
496- MR : Future < Output = Result < R > > + ' a ,
493+ MR : Future < Output = Result < R > > + MaybeSend + ' a ,
497494 R : IntoLuaMulti ,
498495 {
499496 let name = name. to_string ( ) ;
@@ -528,7 +525,7 @@ impl<'a, T: 'static> UserDataMethods<'a, T> for UserDataRegistry<'a, T> {
528525 where
529526 F : Fn ( & ' a Lua , A ) -> FR + MaybeSend + ' static ,
530527 A : FromLuaMulti ,
531- FR : Future < Output = Result < R > > + ' a ,
528+ FR : Future < Output = Result < R > > + MaybeSend + ' a ,
532529 R : IntoLuaMulti ,
533530 {
534531 let name = name. to_string ( ) ;
0 commit comments