From 0ea65a29850bb9bd99808f7246db0a76ae024849 Mon Sep 17 00:00:00 2001 From: Alex Orlenko Date: Sun, 3 Apr 2022 03:12:37 +0100 Subject: [PATCH] Fix doc test --- src/thread.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/thread.rs b/src/thread.rs index d710c92..b478ba4 100644 --- a/src/thread.rs +++ b/src/thread.rs @@ -299,8 +299,9 @@ impl<'lua> Thread<'lua> { /// # Examples /// /// ``` - /// # use mlua::{Lua, Result}; - /// # fn main() -> Result<()> { + /// # #[cfg(feature = "luau")] + /// # fn main() -> mlua::Result<()> { + /// use mlua::Lua; /// let lua = Lua::new(); /// let thread = lua.create_thread(lua.create_function(|lua2, ()| { /// lua2.load("var = 123").exec()?; @@ -314,6 +315,9 @@ impl<'lua> Thread<'lua> { /// assert_eq!(lua.globals().get::<_, Option>("var")?, None); /// # Ok(()) /// # } + /// + /// # #[cfg(not(feature = "luau"))] + /// fn main() {} /// ``` /// /// Requires `feature = "luau"`