Files
aji/tests/conformance/source/lifetimes/resource_use_after_close.aji
T

16 lines
432 B
Rust

// expect: reject E3001
// phase: 6
// spec: docs/spec/06-resources-and-errors.md
// AIR twin: phase2/reject/resource_use_after_close.air
module test.source_resource_use_after_close
fn main(src: cap<fs.read>) -> void effects [fs.read] {
let file = fs.open_read(src, b"/input") or trap;
match fs.close(move file) {
ok => {
mut handle = file; // diagnostic here
}
err(error) => {}
}
}