From bd7eab573a5e5f1366cd5dc3639fef28c4acb32a Mon Sep 17 00:00:00 2001 From: Timon Kruiper Date: Tue, 6 Oct 2020 12:08:12 +0200 Subject: Fix building the zig compiler for 32-bit targets --- src/main.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main.zig') diff --git a/src/main.zig b/src/main.zig index 7564342739..0b75d479d8 100644 --- a/src/main.zig +++ b/src/main.zig @@ -2541,7 +2541,7 @@ fn fmtPathFile( check_mode: bool, dir: fs.Dir, sub_path: []const u8, -) FmtError!void { +) (FmtError || error{Overflow})!void { const source_file = try dir.openFile(sub_path, .{}); var file_closed = false; errdefer if (!file_closed) source_file.close(); @@ -2554,7 +2554,7 @@ fn fmtPathFile( const source_code = source_file.readToEndAllocOptions( fmt.gpa, max_src_size, - stat.size, + try std.math.cast(usize, stat.size), @alignOf(u8), null, ) catch |err| switch (err) { -- cgit v1.2.3