diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-06-11 18:26:01 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-06-11 18:26:01 -0400 |
| commit | ce5d50e4ed519d23d7a467bdfee196093a3f5dc2 (patch) | |
| tree | c4797424b877cd6b2fdfa15e9a45ee1fdffbe659 /std | |
| parent | b3a4ec1bd209c022445b6f70385b3f88517e72f9 (diff) | |
| download | zig-ce5d50e4ed519d23d7a467bdfee196093a3f5dc2.tar.gz zig-ce5d50e4ed519d23d7a467bdfee196093a3f5dc2.zip | |
fix runtime if nested inside comptime if
Diffstat (limited to 'std')
| -rw-r--r-- | std/special/bootstrap.zig | 8 | ||||
| -rw-r--r-- | std/special/panic.zig | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/std/special/bootstrap.zig b/std/special/bootstrap.zig index 45ce23c00f..f1286bd659 100644 --- a/std/special/bootstrap.zig +++ b/std/special/bootstrap.zig @@ -114,20 +114,20 @@ extern fn main(c_argc: i32, c_argv: [*][*]u8, c_envp: [*]?[*]u8) i32 { // and we want fewer call frames in stack traces. inline fn callMain() u8 { switch (@typeId(@typeOf(root.main).ReturnType)) { - builtin.TypeId.NoReturn => { + .NoReturn => { root.main(); }, - builtin.TypeId.Void => { + .Void => { root.main(); return 0; }, - builtin.TypeId.Int => { + .Int => { if (@typeOf(root.main).ReturnType.bit_count != 8) { @compileError("expected return type of main to be 'u8', 'noreturn', 'void', or '!void'"); } return root.main(); }, - builtin.TypeId.ErrorUnion => { + .ErrorUnion => { root.main() catch |err| { std.debug.warn("error: {}\n", @errorName(err)); if (builtin.os != builtin.Os.zen) { diff --git a/std/special/panic.zig b/std/special/panic.zig index 50dc5e0c65..cb2ef8be09 100644 --- a/std/special/panic.zig +++ b/std/special/panic.zig @@ -7,8 +7,8 @@ const builtin = @import("builtin"); const std = @import("std"); pub fn panic(msg: []const u8, error_return_trace: ?*builtin.StackTrace) noreturn { - const stderr = std.io.getStdErr() catch std.process.abort(); - stderr.write("panic: ") catch std.process.abort(); - stderr.write(msg) catch std.process.abort(); + //const stderr = std.io.getStdErr() catch std.process.abort(); + //stderr.write("panic: ") catch std.process.abort(); + //stderr.write(msg) catch std.process.abort(); std.process.abort(); } |
