aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-02-08 17:26:55 -0700
committerAndrew Kelley <andrew@ziglang.org>2022-02-08 17:26:55 -0700
commit5a00e249632716b86edac088f69d19d82e307a28 (patch)
tree2daa825ca0033bd0fb4735c43134c3f9ef783f6c /src
parentfd6c351263e99af4dca73af953711e6d1b57f4e4 (diff)
downloadzig-5a00e249632716b86edac088f69d19d82e307a28.tar.gz
zig-5a00e249632716b86edac088f69d19d82e307a28.zip
std.Progress: make the API infallible
by handling `error.TimerUnsupported`. In this case, only explicit calls to refresh() will cause the progress line to be printed.
Diffstat (limited to 'src')
-rw-r--r--src/Compilation.zig2
-rw-r--r--src/stage1.zig5
2 files changed, 2 insertions, 5 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig
index f07a7c9dd7..bd7581863b 100644
--- a/src/Compilation.zig
+++ b/src/Compilation.zig
@@ -2586,7 +2586,7 @@ pub fn performAllTheWork(self: *Compilation) error{ TimerUnsupported, OutOfMemor
// If the terminal is dumb, we dont want to show the user all the
// output.
var progress: std.Progress = .{ .dont_print_on_dumb = true };
- var main_progress_node = try progress.start("", 0);
+ var main_progress_node = progress.start("", 0);
defer main_progress_node.end();
if (self.color == .off) progress.terminal = null;
diff --git a/src/stage1.zig b/src/stage1.zig
index b716a9c954..005dc312ba 100644
--- a/src/stage1.zig
+++ b/src/stage1.zig
@@ -305,10 +305,7 @@ export fn stage2_progress_start_root(
name_len: usize,
estimated_total_items: usize,
) *std.Progress.Node {
- return progress.start(
- name_ptr[0..name_len],
- estimated_total_items,
- ) catch @panic("timer unsupported");
+ return progress.start(name_ptr[0..name_len], estimated_total_items);
}
// ABI warning