diff options
| author | InKryption <59504965+InKryption@users.noreply.github.com> | 2022-07-24 11:01:56 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-24 12:01:56 +0300 |
| commit | 7cbd586ace46a8e8cebab660ebca3cfc049305d9 (patch) | |
| tree | 10514a09063847aaed2a8dcc9b0f2196f0cc3ef4 /src/main.zig | |
| parent | 0b4a3ec9501b31e7b31e81b83e5974e6c6d72757 (diff) | |
| download | zig-7cbd586ace46a8e8cebab660ebca3cfc049305d9.tar.gz zig-7cbd586ace46a8e8cebab660ebca3cfc049305d9.zip | |
std.fmt: require specifier for unwrapping ?T and E!T.
Co-authored-by: Veikka Tuominen <git@vexu.eu>
Diffstat (limited to 'src/main.zig')
| -rw-r--r-- | src/main.zig | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main.zig b/src/main.zig index 27682003f2..c9b9d1c0af 100644 --- a/src/main.zig +++ b/src/main.zig @@ -3168,7 +3168,7 @@ fn parseCrossTargetOrReportFatalError( @tagName(diags.arch.?), help_text.items, }); } - fatal("Unknown CPU feature: '{s}'", .{diags.unknown_feature_name}); + fatal("Unknown CPU feature: '{s}'", .{diags.unknown_feature_name.?}); }, else => |e| return e, }; @@ -3496,7 +3496,8 @@ fn cmdTranslateC(comp: *Compilation, arena: Allocator, enable_cache: bool, stage } else { const out_zig_path = try fs.path.join(arena, &[_][]const u8{ "o", &digest, translated_zig_basename }); const zig_file = comp.local_cache_directory.handle.openFile(out_zig_path, .{}) catch |err| { - fatal("unable to open cached translated zig file '{s}{s}{s}': {s}", .{ comp.local_cache_directory.path, fs.path.sep_str, out_zig_path, @errorName(err) }); + const path = comp.local_cache_directory.path orelse "."; + fatal("unable to open cached translated zig file '{s}{s}{s}': {s}", .{ path, fs.path.sep_str, out_zig_path, @errorName(err) }); }; defer zig_file.close(); try io.getStdOut().writeFileAll(zig_file, .{}); @@ -3626,7 +3627,8 @@ pub fn cmdInit( .Exe => "init-exe", }; var template_dir = zig_lib_directory.handle.openDir(template_sub_path, .{}) catch |err| { - fatal("unable to open zig project template directory '{s}{s}{s}': {s}", .{ zig_lib_directory.path, s, template_sub_path, @errorName(err) }); + const path = zig_lib_directory.path orelse "."; + fatal("unable to open zig project template directory '{s}{s}{s}': {s}", .{ path, s, template_sub_path, @errorName(err) }); }; defer template_dir.close(); |
