mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 10:59:13 +00:00
feat(ops): V8 Fast Calls (#15291)
This commit is contained in:
parent
e39d4e3e7f
commit
906aa78af3
15 changed files with 504 additions and 38 deletions
27
ops/tests/compile_fail/unsupported.rs
Normal file
27
ops/tests/compile_fail/unsupported.rs
Normal file
|
@ -0,0 +1,27 @@
|
|||
// Copyright 2019-2020 the Deno authors. All rights reserved. MIT license.
|
||||
|
||||
use deno_ops::op;
|
||||
|
||||
#[op(fast)]
|
||||
fn op_result_return(a: i32, b: i32) -> Result<(), ()> {
|
||||
a + b
|
||||
}
|
||||
|
||||
#[op(fast)]
|
||||
fn op_u8_arg(a: u8, b: u8) {
|
||||
//
|
||||
}
|
||||
|
||||
#[op(fast)]
|
||||
fn op_u16_arg(a: u16, b: u16) {
|
||||
//
|
||||
}
|
||||
|
||||
#[op(fast)]
|
||||
async fn op_async_fn(a: i32, b: i32) -> i32 {
|
||||
a + b
|
||||
}
|
||||
|
||||
fn main() {
|
||||
// pass
|
||||
}
|
31
ops/tests/compile_fail/unsupported.stderr
Normal file
31
ops/tests/compile_fail/unsupported.stderr
Normal file
|
@ -0,0 +1,31 @@
|
|||
error: custom attribute panicked
|
||||
--> tests/compile_fail/unsupported.rs:5:1
|
||||
|
|
||||
5 | #[op(fast)]
|
||||
| ^^^^^^^^^^^
|
||||
|
|
||||
= help: message: op cannot be a fast api. enforced by #[op(fast)]
|
||||
|
||||
error: custom attribute panicked
|
||||
--> tests/compile_fail/unsupported.rs:10:1
|
||||
|
|
||||
10 | #[op(fast)]
|
||||
| ^^^^^^^^^^^
|
||||
|
|
||||
= help: message: op cannot be a fast api. enforced by #[op(fast)]
|
||||
|
||||
error: custom attribute panicked
|
||||
--> tests/compile_fail/unsupported.rs:15:1
|
||||
|
|
||||
15 | #[op(fast)]
|
||||
| ^^^^^^^^^^^
|
||||
|
|
||||
= help: message: op cannot be a fast api. enforced by #[op(fast)]
|
||||
|
||||
error: custom attribute panicked
|
||||
--> tests/compile_fail/unsupported.rs:20:1
|
||||
|
|
||||
20 | #[op(fast)]
|
||||
| ^^^^^^^^^^^
|
||||
|
|
||||
= help: message: async op cannot be a fast api. enforced by #[op(fast)]
|
5
ops/tests/mod.rs
Normal file
5
ops/tests/mod.rs
Normal file
|
@ -0,0 +1,5 @@
|
|||
#[test]
|
||||
fn op_macro() {
|
||||
let t = trybuild::TestCases::new();
|
||||
t.compile_fail("tests/compile_fail/*.rs");
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue