cli: add bounded std copy/search and checked arithmetic

This commit is contained in:
dev committed 2026-10-06 15:40:57 +03:00
1 parent a2ca293506
commit 6397a317e2
36 files changed
+1533 -7

No files matched your search

@@ -0,0 +1,19 @@
// expect: run
// result: 2
// phase: 6
// spec: docs/spec/16-standard-library.md §2.4
module test.bounded_offset
import std.bytes;
fn locate(data: slice<u8>) -> usize
effects []
{
match std.bytes.find_slice(ref data[2..data.len], b"ab") {
std.bytes.FindResult::found(index) => { return index; }
std.bytes.FindResult::not_found => { trap; }
}
}
fn main() -> usize
effects []
{ return locate(b"xxzzab"); }