diff options
| author | Veikka Tuominen <git@vexu.eu> | 2022-12-04 15:03:32 +0200 |
|---|---|---|
| committer | Veikka Tuominen <git@vexu.eu> | 2022-12-07 14:48:24 +0200 |
| commit | 92f1a29c4082817f11e12ff58bd4fdb5fffb8608 (patch) | |
| tree | eec9d9d740422b004a0062162c4772a82a402a72 /lib/std | |
| parent | 1310ef75777209f061bfd61473db75911538b5ff (diff) | |
| download | zig-92f1a29c4082817f11e12ff58bd4fdb5fffb8608.tar.gz zig-92f1a29c4082817f11e12ff58bd4fdb5fffb8608.zip | |
AstGen: make `@compileError` operand implicitly comptime
This matches the language reference.
Diffstat (limited to 'lib/std')
| -rw-r--r-- | lib/std/build/OptionsStep.zig | 2 | ||||
| -rw-r--r-- | lib/std/fmt.zig | 2 | ||||
| -rw-r--r-- | lib/std/testing.zig | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/lib/std/build/OptionsStep.zig b/lib/std/build/OptionsStep.zig index 362aa64f33..0ac36bdffe 100644 --- a/lib/std/build/OptionsStep.zig +++ b/lib/std/build/OptionsStep.zig @@ -177,7 +177,7 @@ fn printLiteral(out: anytype, val: anytype, indent: u8) !void { .Float, .Null, => try out.print("{any}", .{val}), - else => @compileError(comptime std.fmt.comptimePrint("`{s}` are not yet supported as build options", .{@tagName(@typeInfo(T))})), + else => @compileError(std.fmt.comptimePrint("`{s}` are not yet supported as build options", .{@tagName(@typeInfo(T))})), } } diff --git a/lib/std/fmt.zig b/lib/std/fmt.zig index ae97b76124..903dd67c3d 100644 --- a/lib/std/fmt.zig +++ b/lib/std/fmt.zig @@ -199,7 +199,7 @@ pub fn format( switch (missing_count) { 0 => unreachable, 1 => @compileError("unused argument in '" ++ fmt ++ "'"), - else => @compileError((comptime comptimePrint("{d}", .{missing_count})) ++ " unused arguments in '" ++ fmt ++ "'"), + else => @compileError(comptimePrint("{d}", .{missing_count}) ++ " unused arguments in '" ++ fmt ++ "'"), } } } diff --git a/lib/std/testing.zig b/lib/std/testing.zig index 1bda46ecce..1a7d3fd732 100644 --- a/lib/std/testing.zig +++ b/lib/std/testing.zig @@ -765,7 +765,7 @@ pub fn checkAllAllocationFailures(backing_allocator: std.mem.Allocator, comptime } const expected_args_tuple_len = fn_args_fields.len - 1; if (extra_args.len != expected_args_tuple_len) { - @compileError("The provided function expects " ++ (comptime std.fmt.comptimePrint("{d}", .{expected_args_tuple_len})) ++ " extra arguments, but the provided tuple contains " ++ (comptime std.fmt.comptimePrint("{d}", .{extra_args.len}))); + @compileError("The provided function expects " ++ std.fmt.comptimePrint("{d}", .{expected_args_tuple_len}) ++ " extra arguments, but the provided tuple contains " ++ std.fmt.comptimePrint("{d}", .{extra_args.len})); } // Setup the tuple that will actually be used with @call (we'll need to insert |
