Files
aji/tests/conformance/phase2/accept/unsafe_assume_fact.air
T
dev 008654999e Phase 2: unsafe operations and trusted boundaries (RFC 0009)
- air: string literals (trusted line only), trusted obligation on
  functions, assume, borrow.index.unchecked
- verifier: unsafe stage (E6001 outside_boundary /
  trusted_declares_unsafe); effect stage leaves unsafe to it, so trusted
  functions discharge it; assume establishes bounds facts
- interp: T0009 for detected unsafe precondition violations
- aji check --report unsafe: trusted functions with obligations, unsafe
  functions, unsafe operations with their boundary
- feature unsafe published and supported; 10 conformance tests;
  3000 mutants without a crash
2026-10-04 14:41:30 +03:00

20 lines
454 B
LLVM

; assume establishes a bounds fact like guard, so borrow.index.proven is accepted.
; expect: accept
; phase: 2
; spec: docs/spec/13-contracts-and-unsafe.md
module test.unsafe_assume_fact
air 0
lang 0.1
features [arrays, effects, ownership, unsafe]
fn @f(%s: slice<u8>, %i: usize) -> u8
effects [unsafe]
entry:
%n = slice.len %s
%c = lt.usize %i, %n
assume %c
%e = borrow.index.proven %s, %i
%v = load %e
borrow.end %e
ret %v