mirror of
https://github.com/mlua-rs/mlua
synced 2026-06-08 16:05:43 +00:00
Drop Lua::async_scope as it's unsound
This commit is contained in:
+1
-22
@@ -56,7 +56,7 @@ use crate::{chunk::Compiler, types::VmState};
|
||||
use {
|
||||
crate::types::{AsyncCallback, AsyncCallbackUpvalue, AsyncPollUpvalue},
|
||||
futures_core::{
|
||||
future::{Future, LocalBoxFuture},
|
||||
future::Future,
|
||||
task::{Context, Poll, Waker},
|
||||
},
|
||||
futures_task::noop_waker,
|
||||
@@ -1887,27 +1887,6 @@ impl Lua {
|
||||
f(&Scope::new(self))
|
||||
}
|
||||
|
||||
/// An asynchronous version of [`scope`] that allows to create scoped async functions and
|
||||
/// execute them.
|
||||
///
|
||||
/// Requires `feature = "async"`
|
||||
///
|
||||
/// [`scope`]: #method.scope
|
||||
#[cfg(feature = "async")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "async")))]
|
||||
pub fn async_scope<'lua, 'scope, R, F, FR>(
|
||||
&'lua self,
|
||||
f: F,
|
||||
) -> LocalBoxFuture<'scope, Result<R>>
|
||||
where
|
||||
'lua: 'scope,
|
||||
R: 'static,
|
||||
F: FnOnce(Scope<'lua, 'scope>) -> FR,
|
||||
FR: 'scope + Future<Output = Result<R>>,
|
||||
{
|
||||
Box::pin(f(Scope::new(self)))
|
||||
}
|
||||
|
||||
/// Attempts to coerce a Lua value into a String in a manner consistent with Lua's internal
|
||||
/// behavior.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user