std.fs.Dir.statFile rework
* revert changes to Module because the error set is consistent across operating systems. * remove duplicated Stat.fromSystem code and use a less redundant name. * make fs.Dir.statFile follow symlinks, and avoid pointless control flow through the posix layer.
This commit is contained in:
@@ -4137,19 +4137,14 @@ pub fn populateBuiltinFile(mod: *Module) !void {
|
||||
};
|
||||
}
|
||||
} else |err| switch (err) {
|
||||
error.BadPathName => unreachable, // it's always "builtin.zig"
|
||||
error.NameTooLong => unreachable, // it's always "builtin.zig"
|
||||
error.PipeBusy => unreachable, // it's not a pipe
|
||||
error.WouldBlock => unreachable, // not asking for non-blocking I/O
|
||||
|
||||
error.FileNotFound => try writeBuiltinFile(file, builtin_pkg),
|
||||
else => |e| {
|
||||
if (builtin.os.tag == .windows) {
|
||||
switch (e) {
|
||||
error.BadPathName => unreachable, // it's always "builtin.zig"
|
||||
error.PipeBusy => unreachable, // it's not a pipe
|
||||
error.WouldBlock => unreachable, // not asking for non-blocking I/O
|
||||
else => return e,
|
||||
}
|
||||
}
|
||||
return e;
|
||||
},
|
||||
|
||||
else => |e| return e,
|
||||
}
|
||||
|
||||
file.tree = try std.zig.parse(gpa, file.source);
|
||||
|
||||
Reference in New Issue
Block a user