summaryrefslogtreecommitdiff
path: root/ops/tests/compile_fail/mem_slices.rs
blob: da74ac57772c0d593478e1e72bdec1959398f15b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

use deno_ops::op;

#[op]
fn sync_test(slice: &mut [u32]) {
  //
}

#[op]
async fn async_test(slice: &[u8]) {
  // Memory slices are not allowed in async ops.
}

#[op]
fn async_test2(slice: &mut [u8]) -> impl Future<Output = ()> {
  // Memory slices are not allowed in async ops, even when not implemented as an
  // async function.
  async {}
}

fn main() {
  // pass
}