authorgravatar for lukas@lalinsky.comLukas Lalinsky <lukas@lalinsky.com> 2026-04-18 09:35:28+02:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-04-19 10:07:44-07:00
log52e06ce4f665b737d86fe6ab4d5d896e844d3eda
tree70185e2e88cefe7c90a73cc6778863a3d83442c1
parent9b177a7d21250b82cd18677c5c71ab04e431120d

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.

1 files changed, 2 insertions(+), 2 deletions(-)

lib/std/Io/Dir.zig+2-2
...@@ -1993,7 +1993,7 @@ pub fn setFileOwner(...@@ -1993,7 +1993,7 @@ pub fn setFileOwner(
1993 owner: ?File.Uid,1993 owner: ?File.Uid,
1994 group: ?File.Gid,1994 group: ?File.Gid,
1995 options: SetFileOwnerOptions,1995 options: SetFileOwnerOptions,
1996) SetOwnerError!void {1996) SetFileOwnerError!void {
1997 return io.vtable.dirSetFileOwner(io.userdata, dir, sub_path, owner, group, options);1997 return io.vtable.dirSetFileOwner(io.userdata, dir, sub_path, owner, group, options);
1998}1998}
19991999
...@@ -2032,7 +2032,7 @@ pub fn setTimestampsNow(...@@ -2032,7 +2032,7 @@ pub fn setTimestampsNow(
2032 sub_path: []const u8,2032 sub_path: []const u8,
2033 options: SetTimestampsNowOptions,2033 options: SetTimestampsNowOptions,
2034) SetTimestampsError!void {2034) SetTimestampsError!void {
2035 return io.vtable.fileSetTimestamps(io.userdata, dir, sub_path, .{2035 return io.vtable.dirSetTimestamps(io.userdata, dir, sub_path, .{
2036 .follow_symlinks = options.follow_symlinks,2036 .follow_symlinks = options.follow_symlinks,
2037 .access_timestamp = .now,2037 .access_timestamp = .now,
2038 .modify_timestamp = .now,2038 .modify_timestamp = .now,