@@ -2,7 +2,7 @@ use std::any::TypeId;
22use std:: cell:: RefCell ;
33use std:: marker:: PhantomData ;
44use std:: ops:: Deref ;
5- use std:: os:: raw:: { c_int, c_void } ;
5+ use std:: os:: raw:: c_int;
66use std:: panic:: Location ;
77use std:: result:: Result as StdResult ;
88use std:: { fmt, mem, ptr} ;
@@ -18,8 +18,8 @@ use crate::string::String;
1818use crate :: table:: Table ;
1919use crate :: thread:: Thread ;
2020use crate :: types:: {
21- AppDataRef , AppDataRefMut , ArcReentrantMutexGuard , Integer , LightUserData , MaybeSend , Number ,
22- ReentrantMutex , ReentrantMutexGuard , RegistryKey , XRc , XWeak ,
21+ AppDataRef , AppDataRefMut , ArcReentrantMutexGuard , Integer , MaybeSend , Number , ReentrantMutex ,
22+ ReentrantMutexGuard , RegistryKey , XRc , XWeak ,
2323} ;
2424use crate :: userdata:: { AnyUserData , UserData , UserDataProxy , UserDataRegistry , UserDataStorage } ;
2525use crate :: util:: {
@@ -34,7 +34,10 @@ use crate::hook::HookTriggers;
3434use crate :: { chunk:: Compiler , types:: VmState } ;
3535
3636#[ cfg( feature = "async" ) ]
37- use std:: future:: { self , Future } ;
37+ use {
38+ crate :: types:: LightUserData ,
39+ std:: future:: { self , Future } ,
40+ } ;
3841
3942#[ cfg( feature = "serialize" ) ]
4043use serde:: Serialize ;
@@ -284,6 +287,7 @@ impl Lua {
284287 ///
285288 /// This method ensures that the Lua instance is locked while the function is called
286289 /// and restores Lua stack after the function returns.
290+ #[ allow( clippy:: missing_safety_doc) ]
287291 pub unsafe fn with_raw_state < R : FromLuaMulti > (
288292 & self ,
289293 args : impl IntoLuaMulti ,
@@ -648,7 +652,7 @@ impl Lua {
648652 F : Fn ( & Lua , & str , bool ) -> Result < ( ) > + MaybeSend + ' static ,
649653 {
650654 use std:: ffi:: CStr ;
651- use std:: os:: raw:: c_char;
655+ use std:: os:: raw:: { c_char, c_void } ;
652656 use std:: string:: String as StdString ;
653657
654658 unsafe extern "C-unwind" fn warn_proc ( ud : * mut c_void , msg : * const c_char , tocont : c_int ) {
@@ -1825,7 +1829,7 @@ impl Lua {
18251829 #[ inline( always) ]
18261830 pub fn poll_pending ( ) -> LightUserData {
18271831 static ASYNC_POLL_PENDING : u8 = 0 ;
1828- LightUserData ( & ASYNC_POLL_PENDING as * const u8 as * mut c_void )
1832+ LightUserData ( & ASYNC_POLL_PENDING as * const u8 as * mut std :: os :: raw :: c_void )
18291833 }
18301834
18311835 // Luau version located in `luau/mod.rs`
@@ -1874,6 +1878,7 @@ impl Lua {
18741878 /// Returns a handle to the unprotected Lua state without any synchronization.
18751879 ///
18761880 /// This is useful where we know that the lock is already held by the caller.
1881+ #[ cfg( feature = "async" ) ]
18771882 #[ inline( always) ]
18781883 pub ( crate ) unsafe fn raw_lua ( & self ) -> & RawLua {
18791884 & * self . raw . data_ptr ( )
0 commit comments