From 52e06ce4f665b737d86fe6ab4d5d896e844d3eda Mon Sep 17 00:00:00 2001 From: Lukas Lalinsky Date: Sat, 18 Apr 2026 09:35:28 +0200 Subject: [PATCH 1/2] std.Io.Dir: fix incorrect return types in setFileOwner and setTimestampsNow `setFileOwner` declared `SetOwnerError!void` but its vtable method returns the wider `SetFileOwnerError!void` (adds `NameTooLong` and `BadPathName`), so any call through the wrapper fails to compile. `setTimestampsNow` dispatched to `io.vtable.fileSetTimestamps` with `(Dir, []const u8, Dir.SetTimestampsOptions)`, but that vtable entry takes `(File, File.SetTimestampsOptions)`. The intended target is `dirSetTimestamps`, whose signature matches the call site. --- lib/std/Io/Dir.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/std/Io/Dir.zig b/lib/std/Io/Dir.zig index 68b432c38e..49e6c8e9ef 100644 --- a/lib/std/Io/Dir.zig +++ b/lib/std/Io/Dir.zig @@ -1993,7 +1993,7 @@ pub fn setFileOwner( owner: ?File.Uid, group: ?File.Gid, options: SetFileOwnerOptions, -) SetOwnerError!void { +) SetFileOwnerError!void { return io.vtable.dirSetFileOwner(io.userdata, dir, sub_path, owner, group, options); } @@ -2032,7 +2032,7 @@ pub fn setTimestampsNow( sub_path: []const u8, options: SetTimestampsNowOptions, ) SetTimestampsError!void { - return io.vtable.fileSetTimestamps(io.userdata, dir, sub_path, .{ + return io.vtable.dirSetTimestamps(io.userdata, dir, sub_path, .{ .follow_symlinks = options.follow_symlinks, .access_timestamp = .now, .modify_timestamp = .now, From 50f96d2ca161db0e821b4d08baf6bdb9938a5937 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sun, 19 Apr 2026 10:08:23 -0700 Subject: [PATCH 2/2] std.Io.Dir: add type checking for those two functions --- lib/std/Io/Dir.zig | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/std/Io/Dir.zig b/lib/std/Io/Dir.zig index 49e6c8e9ef..95388eac78 100644 --- a/lib/std/Io/Dir.zig +++ b/lib/std/Io/Dir.zig @@ -2038,3 +2038,8 @@ pub fn setTimestampsNow( .modify_timestamp = .now, }); } + +test { + _ = &setFileOwner; + _ = &setTimestampsNow; +}