authorgravatar for davidatgit@gmail.comDavid John <davidatgit@gmail.com> 2021-12-10 11:47:38+05:30
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2022-01-27 19:42:40+02:00
log80ac022c4667e1995ccdf70fff90e5af26b6eb97
tree6ac43e59c2ff304c8d3ae646f3bab5150a49cb71
parentdb1edb6535383817c6f597f55a35fc892d1c22c5

add std.debug.todo


1 files changed, 9 insertions(+), 0 deletions(-)

lib/std/debug.zig+9
......@@ -66,6 +66,15 @@ pub fn print(comptime fmt: []const u8, args: anytype) void {
6666 nosuspend stderr.print(fmt, args) catch return;
6767}
6868
69/// Indicates code that is unfinshed. It will throw a compiler error by default in Release mode.
70/// This behaviour can be controlled with `root.allow_todo_in_release`.
71pub fn todo(comptime desc: []const u8) noreturn {
72 if (builtin.mode != .Debug and !(@hasDecl(root, "allow_todo_in_release") and root.allow_todo_in_release)) {
73 @compileError("TODO: " ++ desc);
74 }
75 @panic("TODO: " ++ desc);
76}
77
6978pub fn getStderrMutex() *std.Thread.Mutex {
7079 return &stderr_mutex;
7180}