12 lines
610 B
Rust
12 lines
610 B
Rust
// expect: reject E7005
|
|
// phase: 6
|
|
// spec: docs/spec/15-source-language.md §10
|
|
module test.nonvalue_operands
|
|
fn stop() -> never effects [] { trap; }
|
|
fn nothing() -> void effects [] {}
|
|
fn take(x: u64) -> u64 effects [] { return x; }
|
|
fn two(x: u64, y: u64) -> u64 effects [] { return x + y; }
|
|
struct Pair { a: u64, b: u64 }
|
|
enum Choice { Some(u64), None }
|
|
fn main(heap: cap<mem.alloc>) -> void effects [mem.alloc, task.wait] { match channel.make<u64>(1usize, heap) { ok(tx, rx) => { mut t = tx; select { send(t, stop()) { ok => {} closed(x) => {} } cancelled(x) => { trap; } } trap; } err(e) => { trap; } } }
|