diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-02-17 19:54:26 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-02-18 19:17:21 -0700 |
| commit | 321ccbdc525ab0f5862e42378b962c10ec54e4a1 (patch) | |
| tree | c3f7ddbd4e78b3aea1905f32c6c314f1933722c2 /lib/std/builtin.zig | |
| parent | 5029e5364caccac07f2296c1f30f2f238f13864d (diff) | |
| download | zig-321ccbdc525ab0f5862e42378b962c10ec54e4a1.tar.gz zig-321ccbdc525ab0f5862e42378b962c10ec54e4a1.zip | |
Sema: implement for_len
This also makes another breaking change to for loops: in order to
capture a pointer of an element, one must take the address of array
values. This simplifies a lot of things, and makes more sense than how
it was before semantically.
It is still legal to use a for loop on an array value if the
corresponding element capture is byval instead of byref.
Diffstat (limited to 'lib/std/builtin.zig')
| -rw-r--r-- | lib/std/builtin.zig | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/std/builtin.zig b/lib/std/builtin.zig index 74c61d229b..869756fe5c 100644 --- a/lib/std/builtin.zig +++ b/lib/std/builtin.zig @@ -975,6 +975,7 @@ pub const panic_messages = struct { pub const unwrap_error = "attempt to unwrap error"; pub const index_out_of_bounds = "index out of bounds"; pub const start_index_greater_than_end = "start index is larger than end index"; + pub const for_len_mismatch = "for loop over objects with non-equal lengths"; }; pub noinline fn returnError(st: *StackTrace) void { |
