From f1e357ce52bce0bca1c39db37e3be62d09e48436 Mon Sep 17 00:00:00 2001 From: Alex Orlenko Date: Wed, 1 Dec 2021 00:28:08 +0000 Subject: [PATCH] Hide (doc) into_static/from_static methods --- src/lua.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lua.rs b/src/lua.rs index a18db8b..e48c0b8 100644 --- a/src/lua.rs +++ b/src/lua.rs @@ -689,6 +689,7 @@ impl Lua { /// This `Lua` object can then be dropped which will properly release the allocated memory. /// /// [`Lua::from_static`]: #method.from_static + #[doc(hidden)] pub fn into_static(self) -> &'static Self { Box::leak(Box::new(self)) } @@ -697,6 +698,7 @@ impl Lua { /// /// # Safety /// This function is unsafe because improper use may lead to memory problems or undefined behavior. + #[doc(hidden)] pub unsafe fn from_static(lua: &'static Lua) -> Self { *Box::from_raw(lua as *const Lua as *mut Lua) }