diff --git a/src/Module.zig b/src/Module.zig index 6f0fd7bfb0df439a02d5541a55790d07d680dfbd..0ae61587589392456c9a936f972fd90399a72522 100644 --- a/src/Module.zig +++ b/src/Module.zig @@ -1071,7 +1071,7 @@ pub const Scope = struct { if (stat.size > std.math.maxInt(u32)) return error.FileTooBig; - const source = try gpa.allocSentinel(u8, stat.size, 0); + const source = try gpa.allocSentinel(u8, @intCast(usize, stat.size), 0); defer if (!file.source_loaded) gpa.free(source); const amt = try f.readAll(source); if (amt != stat.size) @@ -2441,7 +2441,7 @@ pub fn astGenFile(mod: *Module, file: *Scope.File, prog_node: *std.Progress.Node if (stat.size > std.math.maxInt(u32)) return error.FileTooBig; - const source = try gpa.allocSentinel(u8, stat.size, 0); + const source = try gpa.allocSentinel(u8, @intCast(usize, stat.size), 0); defer if (!file.source_loaded) gpa.free(source); const amt = try source_file.readAll(source); if (amt != stat.size) diff --git a/src/Sema.zig b/src/Sema.zig index bf0158b37a850c16df2e780e4ada80b284e21f9f..64b0988f075095d92c69c618d475dc74b01d0c24 100644 --- a/src/Sema.zig +++ b/src/Sema.zig @@ -2483,7 +2483,7 @@ fn zirIntToError(sema: *Sema, block: *Scope.Block, inst: Zir.Inst.Index) InnerEr const payload = try sema.arena.create(Value.Payload.Error); payload.* = .{ .base = .{ .tag = .@"error" }, - .data = .{ .name = sema.mod.error_name_list.items[int] }, + .data = .{ .name = sema.mod.error_name_list.items[@intCast(usize, int)] }, }; return sema.mod.constInst(sema.arena, src, .{ .ty = Type.initTag(.anyerror), diff --git a/src/main.zig b/src/main.zig index 4b8f30b10935ff271edb3e6a72c5b056222e68c6..455f19cccc804a17172ca9dafef332461fb989c6 100644 --- a/src/main.zig +++ b/src/main.zig @@ -3642,7 +3642,7 @@ pub fn cmdAstCheck( if (stat.size > max_src_size) return error.FileTooBig; - const source = try arena.allocSentinel(u8, stat.size, 0); + const source = try arena.allocSentinel(u8, @intCast(usize, stat.size), 0); const amt = try f.readAll(source); if (amt != stat.size) return error.UnexpectedEndOfFile; @@ -3778,7 +3778,7 @@ pub fn cmdChangelist( .root_decl = null, }; - const source = try arena.allocSentinel(u8, stat.size, 0); + const source = try arena.allocSentinel(u8, @intCast(usize, stat.size), 0); const amt = try f.readAll(source); if (amt != stat.size) return error.UnexpectedEndOfFile; @@ -3818,7 +3818,7 @@ pub fn cmdChangelist( if (new_stat.size > max_src_size) return error.FileTooBig; - const new_source = try arena.allocSentinel(u8, new_stat.size, 0); + const new_source = try arena.allocSentinel(u8, @intCast(usize, new_stat.size), 0); const new_amt = try new_f.readAll(new_source); if (new_amt != new_stat.size) return error.UnexpectedEndOfFile; diff --git a/src/type.zig b/src/type.zig index e54413ffb959478524d2fe287b2ab413c90bfced..14646450aa9aa1547fcf911a9ccc019ea261fbbb 100644 --- a/src/type.zig +++ b/src/type.zig @@ -2641,7 +2641,7 @@ pub const Type = extern union { }; const end_val = Value.initPayload(&end_payload.base); if (int_val.compare(.gte, end_val)) return null; - return int_val.toUnsignedInt(); + return @intCast(usize, int_val.toUnsignedInt()); } }; switch (ty.tag()) {