aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/eval.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-02-17 20:23:33 -0700
committerAndrew Kelley <andrew@ziglang.org>2023-02-18 19:17:21 -0700
commitf0530385b57218ef323747bdb7438330a07d25cc (patch)
tree07d87e78355e518aa67ea48e3cdf1a242917a5d7 /test/behavior/eval.zig
parent321ccbdc525ab0f5862e42378b962c10ec54e4a1 (diff)
downloadzig-f0530385b57218ef323747bdb7438330a07d25cc.tar.gz
zig-f0530385b57218ef323747bdb7438330a07d25cc.zip
update existing behavior tests and std lib to new for loop semantics
Diffstat (limited to 'test/behavior/eval.zig')
-rw-r--r--test/behavior/eval.zig6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/behavior/eval.zig b/test/behavior/eval.zig
index 2a1f2b7155..680b0576d5 100644
--- a/test/behavior/eval.zig
+++ b/test/behavior/eval.zig
@@ -317,7 +317,7 @@ test "create global array with for loop" {
const global_array = x: {
var result: [10]usize = undefined;
- for (result) |*item, index| {
+ for (&result, 0..) |*item, index| {
item.* = index * index;
}
break :x result;
@@ -447,7 +447,7 @@ test "binary math operator in partially inlined function" {
var s: [4]u32 = undefined;
var b: [16]u8 = undefined;
- for (b) |*r, i|
+ for (&b, 0..) |*r, i|
r.* = @intCast(u8, i + 1);
copyWithPartialInline(s[0..], b[0..]);
@@ -915,7 +915,7 @@ test "comptime pointer load through elem_ptr" {
comptime {
var array: [10]S = undefined;
- for (array) |*elem, i| {
+ for (&array, 0..) |*elem, i| {
elem.* = .{
.x = i,
};