| author | |
| committer | |
| log | 133579d7c05a92e33bd8a4cfaf5c460f48150de7 |
| tree | 32a7dec3c31da1d84baa6bfedbf0b19abf854090 |
| parent | 03cc81665bb28eb35c8c6d4be17b5a56fa66261f |
| signature |
4 files changed, 12 insertions(+), 11 deletions(-)
src-self-hosted/compilation.zig+5-4| ... | @@ -548,10 +548,11 @@ pub const Compilation = struct { | ... | @@ -548,10 +548,11 @@ pub const Compilation = struct { |
| 548 | 548 | ||
| 549 | comp.deinit_group.wait(); | 549 | comp.deinit_group.wait(); |
| 550 | 550 | ||
| 551 | if (comp.tmp_dir.getOrNull()) |tmp_dir_result| if (tmp_dir_result.*) |tmp_dir| { | 551 | if (comp.tmp_dir.getOrNull()) |tmp_dir_result| |
| 552 | // TODO evented I/O? | 552 | if (tmp_dir_result.*) |tmp_dir| { |
| 553 | std.fs.deleteTree(tmp_dir) catch {}; | 553 | // TODO evented I/O? |
| 554 | } else |_| {}; | 554 | std.fs.deleteTree(tmp_dir) catch {}; |
| 555 | } else |_| {}; | ||
| 555 | } | 556 | } |
| 556 | 557 | ||
| 557 | /// it does ref the result because it could be an arbitrary integer size | 558 | /// it does ref the result because it could be an arbitrary integer size |
src-self-hosted/libc_installation.zig+2-2| ... | @@ -138,7 +138,7 @@ pub const LibCInstallation = struct { | ... | @@ -138,7 +138,7 @@ pub const LibCInstallation = struct { |
| 138 | self.static_lib_dir orelse "", | 138 | self.static_lib_dir orelse "", |
| 139 | self.msvc_lib_dir orelse "", | 139 | self.msvc_lib_dir orelse "", |
| 140 | self.kernel32_lib_dir orelse "", | 140 | self.kernel32_lib_dir orelse "", |
| 141 | self.dynamic_linker_path orelse util.getDynamicLinkerPath(Target(Target.Native)), | 141 | self.dynamic_linker_path orelse util.getDynamicLinkerPath(Target{ .Native = {} }), |
| 142 | ); | 142 | ); |
| 143 | } | 143 | } |
| 144 | 144 | ||
| ... | @@ -382,7 +382,7 @@ pub const LibCInstallation = struct { | ... | @@ -382,7 +382,7 @@ pub const LibCInstallation = struct { |
| 382 | 382 | ||
| 383 | fn initEmpty(self: *LibCInstallation) void { | 383 | fn initEmpty(self: *LibCInstallation) void { |
| 384 | self.* = LibCInstallation{ | 384 | self.* = LibCInstallation{ |
| 385 | .include_dir = ([*]const u8)(undefined)[0..0], | 385 | .include_dir = @as([*]const u8, undefined)[0..0], |
| 386 | .lib_dir = null, | 386 | .lib_dir = null, |
| 387 | .static_lib_dir = null, | 387 | .static_lib_dir = null, |
| 388 | .msvc_lib_dir = null, | 388 | .msvc_lib_dir = null, |
src-self-hosted/main.zig+1-1| ... | @@ -631,7 +631,7 @@ fn cmdFmt(allocator: *Allocator, args: []const []const u8) !void { | ... | @@ -631,7 +631,7 @@ fn cmdFmt(allocator: *Allocator, args: []const []const u8) !void { |
| 631 | } | 631 | } |
| 632 | if (flags.present("check")) { | 632 | if (flags.present("check")) { |
| 633 | const anything_changed = try std.zig.render(allocator, io.null_out_stream, tree); | 633 | const anything_changed = try std.zig.render(allocator, io.null_out_stream, tree); |
| 634 | const code = if (anything_changed) u8(1) else u8(0); | 634 | const code: u8 = if (anything_changed) 1 else 0; |
| 635 | process.exit(code); | 635 | process.exit(code); |
| 636 | } | 636 | } |
| 637 | 637 |
src-self-hosted/type.zig+4-4| ... | @@ -294,7 +294,7 @@ pub const Type = struct { | ... | @@ -294,7 +294,7 @@ pub const Type = struct { |
| 294 | if (self.alignment) |self_align| { | 294 | if (self.alignment) |self_align| { |
| 295 | if (self_align != other.alignment.?) return false; | 295 | if (self_align != other.alignment.?) return false; |
| 296 | } | 296 | } |
| 297 | if (@TagType(Data)(self.data) != @TagType(Data)(other.data)) return false; | 297 | if (@as(@TagType(Data), self.data) != @as(@TagType(Data), other.data)) return false; |
| 298 | switch (self.data) { | 298 | switch (self.data) { |
| 299 | .Generic => |*self_generic| { | 299 | .Generic => |*self_generic| { |
| 300 | const other_generic = &other.data.Generic; | 300 | const other_generic = &other.data.Generic; |
| ... | @@ -665,7 +665,7 @@ pub const Type = struct { | ... | @@ -665,7 +665,7 @@ pub const Type = struct { |
| 665 | self.mut != other.mut or | 665 | self.mut != other.mut or |
| 666 | self.vol != other.vol or | 666 | self.vol != other.vol or |
| 667 | self.size != other.size or | 667 | self.size != other.size or |
| 668 | @TagType(Align)(self.alignment) != @TagType(Align)(other.alignment)) | 668 | @as(@TagType(Align), self.alignment) != @as(@TagType(Align), other.alignment)) |
| 669 | { | 669 | { |
| 670 | return false; | 670 | return false; |
| 671 | } | 671 | } |
| ... | @@ -1058,7 +1058,7 @@ fn hashAny(x: var, comptime seed: u64) u32 { | ... | @@ -1058,7 +1058,7 @@ fn hashAny(x: var, comptime seed: u64) u32 { |
| 1058 | comptime var rng = comptime std.rand.DefaultPrng.init(seed); | 1058 | comptime var rng = comptime std.rand.DefaultPrng.init(seed); |
| 1059 | const unsigned_x = @bitCast(@IntType(false, info.bits), x); | 1059 | const unsigned_x = @bitCast(@IntType(false, info.bits), x); |
| 1060 | if (info.bits <= 32) { | 1060 | if (info.bits <= 32) { |
| 1061 | return u32(unsigned_x) *% comptime rng.random.scalar(u32); | 1061 | return @as(u32, unsigned_x) *% comptime rng.random.scalar(u32); |
| 1062 | } else { | 1062 | } else { |
| 1063 | return @truncate(u32, unsigned_x *% comptime rng.random.scalar(@typeOf(unsigned_x))); | 1063 | return @truncate(u32, unsigned_x *% comptime rng.random.scalar(@typeOf(unsigned_x))); |
| 1064 | } | 1064 | } |
| ... | @@ -1081,7 +1081,7 @@ fn hashAny(x: var, comptime seed: u64) u32 { | ... | @@ -1081,7 +1081,7 @@ fn hashAny(x: var, comptime seed: u64) u32 { |
| 1081 | if (x) |non_opt| { | 1081 | if (x) |non_opt| { |
| 1082 | return hashAny(non_opt, seed); | 1082 | return hashAny(non_opt, seed); |
| 1083 | } else { | 1083 | } else { |
| 1084 | return hashAny(u32(1), seed); | 1084 | return hashAny(@as(u32, 1), seed); |
| 1085 | } | 1085 | } |
| 1086 | }, | 1086 | }, |
| 1087 | else => @compileError("implement hash function for " ++ @typeName(@typeOf(x))), | 1087 | else => @compileError("implement hash function for " ++ @typeName(@typeOf(x))), |