summaryrefslogtreecommitdiff
path: root/ops/tests/compile_fail
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2022-09-01 15:53:06 +0530
committerGitHub <noreply@github.com>2022-09-01 15:53:06 +0530
commit805ce6fdf70f09e9b3f73b48d42e475a4189a904 (patch)
tree9adb11a33dbb026a28f6791c7e1d0d6d1a91917b /ops/tests/compile_fail
parentcbd830771073e5cb64b4984bf6a1bc21a90812e0 (diff)
feat(ops): support `v8::FastApiCallbackOptions` (#15721)
Diffstat (limited to 'ops/tests/compile_fail')
-rw-r--r--ops/tests/compile_fail/unsupported.rs7
-rw-r--r--ops/tests/compile_fail/unsupported.stderr20
2 files changed, 25 insertions, 2 deletions
diff --git a/ops/tests/compile_fail/unsupported.rs b/ops/tests/compile_fail/unsupported.rs
index 1c4d6407a..52d55de5b 100644
--- a/ops/tests/compile_fail/unsupported.rs
+++ b/ops/tests/compile_fail/unsupported.rs
@@ -17,6 +17,13 @@ fn op_u16_arg(a: u16, b: u16) {
//
}
+use deno_core::v8::fast_api::FastApiCallbackOptions;
+
+#[op(fast)]
+fn op_callback_options(options: &mut FastApiCallbackOptions) {
+ // fast callback options must be an Option.
+}
+
#[op(fast)]
async fn op_async_fn(a: i32, b: i32) -> i32 {
a + b
diff --git a/ops/tests/compile_fail/unsupported.stderr b/ops/tests/compile_fail/unsupported.stderr
index 68c9f7f16..88d1c1fe4 100644
--- a/ops/tests/compile_fail/unsupported.stderr
+++ b/ops/tests/compile_fail/unsupported.stderr
@@ -23,9 +23,25 @@ error: custom attribute panicked
= help: message: op cannot be a fast api. enforced by #[op(fast)]
error: custom attribute panicked
- --> tests/compile_fail/unsupported.rs:20:1
+ --> tests/compile_fail/unsupported.rs:22:1
|
-20 | #[op(fast)]
+22 | #[op(fast)]
+ | ^^^^^^^^^^^
+ |
+ = help: message: op cannot be a fast api. enforced by #[op(fast)]
+
+error: custom attribute panicked
+ --> tests/compile_fail/unsupported.rs:27:1
+ |
+27 | #[op(fast)]
| ^^^^^^^^^^^
|
= help: message: async op cannot be a fast api. enforced by #[op(fast)]
+
+warning: unused import: `deno_core::v8::fast_api::FastApiCallbackOptions`
+ --> tests/compile_fail/unsupported.rs:20:5
+ |
+20 | use deno_core::v8::fast_api::FastApiCallbackOptions;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: `#[warn(unused_imports)]` on by default