cli: map block diagnostics to their source constructs
This commit is contained in:
1 parent
1495650587
commit
1a80c42289
30 files changed
+555
-27
No files matched your search
@@ -0,0 +1,20 @@
|
||||
// expect: reject E3002
|
||||
// phase: 6
|
||||
// spec: docs/spec/06-resources-and-errors.md
|
||||
module test.source_select_join
|
||||
fn main(src: cap<fs.read>, heap: cap<mem.alloc>) -> void effects [fs.read, mem.alloc, task.wait] {
|
||||
let file = fs.open_read(src, b"/input") or trap;
|
||||
match channel.make<u64>(1usize, heap) {
|
||||
ok(tx, rx) => {
|
||||
select { // diagnostic here
|
||||
recv(rx) {
|
||||
ok(value) => { fs.close(move file) or trap; }
|
||||
closed => {}
|
||||
}
|
||||
cancelled => {}
|
||||
}
|
||||
trap;
|
||||
}
|
||||
err(error) => { trap; }
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user