summaryrefslogtreecommitdiff
path: root/ops/optimizer_tests/issue16934_fast.rs
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2022-12-05 08:10:22 -0800
committerGitHub <noreply@github.com>2022-12-05 21:40:22 +0530
commit55595ca1b74e07eb2365d5aec3861600e2266470 (patch)
tree3d32d362e60b8c2b6fbf9e57f939afb8f52f42db /ops/optimizer_tests/issue16934_fast.rs
parent715f35d635bf5a4e972238e6ac8d290c0e096083 (diff)
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) ```
Diffstat (limited to 'ops/optimizer_tests/issue16934_fast.rs')
-rw-r--r--ops/optimizer_tests/issue16934_fast.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/ops/optimizer_tests/issue16934_fast.rs b/ops/optimizer_tests/issue16934_fast.rs
new file mode 100644
index 000000000..8d3488e9d
--- /dev/null
+++ b/ops/optimizer_tests/issue16934_fast.rs
@@ -0,0 +1,8 @@
+async fn send_stdin(state: &mut OpState, v: i32) -> Result<(), anyhow::Error> {
+ // @test-attr:fast
+ //
+ // https://github.com/denoland/deno/issues/16934
+ //
+ // OpState borrowed across await point is not allowed, as it will likely panic at runtime.
+ Ok(())
+}