From 24e14c48740ca0903ba54247e4c8ba542726513d Mon Sep 17 00:00:00 2001 From: Alex Orlenko Date: Sun, 9 Jul 2023 12:33:21 +0100 Subject: Always set hook on a current Lua context (state) and remove MainThreadNotAvailable as no longer needed --- src/error.rs | 8 -------- 1 file changed, 8 deletions(-) (limited to 'src/error.rs') diff --git a/src/error.rs b/src/error.rs index 784434c..88dce2a 100644 --- a/src/error.rs +++ b/src/error.rs @@ -47,11 +47,6 @@ pub enum Error { /// This error can only happen when Lua state was not created by us and does not have the /// custom allocator attached. MemoryLimitNotAvailable, - /// Main thread is not available. - /// - /// This error can only happen in Lua5.1/LuaJIT module mode, when module loaded within a coroutine. - /// These Lua versions does not have `LUA_RIDX_MAINTHREAD` registry key. - MainThreadNotAvailable, /// A mutable callback has triggered Lua code that has called the same mutable callback again. /// /// This is an error because a mutable callback can only be borrowed mutably once. @@ -226,9 +221,6 @@ impl fmt::Display for Error { Error::MemoryLimitNotAvailable => { write!(fmt, "setting memory limit is not available") } - Error::MainThreadNotAvailable => { - write!(fmt, "main thread is not available in Lua 5.1") - } Error::RecursiveMutCallback => write!(fmt, "mutable callback called recursively"), Error::CallbackDestructed => write!( fmt, -- cgit v1.2.3