From 52e06ce4f665b737d86fe6ab4d5d896e844d3eda Mon Sep 17 00:00:00 2001 From: Lukas Lalinsky Date: Sat, 18 Apr 2026 09:35:28 +0200 Subject: [PATCH] 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 68b432c38e3a3214c8260d75bdcf059754a005a9..49e6c8e9efa37bdd226c227fe9d88c954d2c689c 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, -- 2.54.0