12 lines
510 B
Rust
12 lines
510 B
Rust
// fs.create receives cap<fs.read> instead of required cap<fs.write>; expected/found authority facts agree.
|
|
// expect: reject E3201
|
|
// phase: 6
|
|
// spec: docs/spec/05-effects-and-capabilities.md §10.5
|
|
// AIR twin: phase2/reject/wrong_capability_kind.air
|
|
module test.source_wrong_capability_kind
|
|
fn f(c: cap<fs.read>, p: slice<u8>) -> void effects [fs.write] {
|
|
let file = fs.create(c, p) or trap; // diagnostic here: fs.create
|
|
fs.close(move file) or trap;
|
|
}
|
|
fn main() -> u64 effects [] { return 0u64; }
|