From 55595ca1b74e07eb2365d5aec3861600e2266470 Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Mon, 5 Dec 2022 08:10:22 -0800 Subject: fix(ops): disallow auto-borrowing OpState across potential await point (#16952) Fixes https://github.com/denoland/deno/issues/16934 Example compiler error: ``` error: mutable opstate is not supported in async ops --> core/ops_builtin.rs:122:1 | 122 | #[op] | ^^^^^ | = note: this error originates in the attribute macro `op` (in Nightly builds, run with -Z macro-backtrace for more info) ``` --- ext/ffi/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ext/ffi') diff --git a/ext/ffi/lib.rs b/ext/ffi/lib.rs index 52e101a92..7e7756c93 100644 --- a/ext/ffi/lib.rs +++ b/ext/ffi/lib.rs @@ -1829,9 +1829,10 @@ impl Future for CallbackInfo { #[op] fn op_ffi_unsafe_callback_ref( - state: &mut deno_core::OpState, + state: Rc>, rid: ResourceId, ) -> Result>, AnyError> { + let state = state.borrow(); let callback_resource = state.resource_table.get::(rid)?; -- cgit v1.2.3