authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-10-12 05:26:11-04:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2022-10-12 05:26:11-04:00
log7ce1ee1bce4d9ca05a647c9c390c6525be0b6362
treea65ac3b2e1f252a1cc7c5efa6e70f0320034e823
parentbec40a89c21009ea7f2c41362cc13d27f065b43e
parent8e2aaf6aed5213736f6cbbb374098e2394f19429
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

Merge pull request #13081 from r00ster91/docs

fix(text): hyphenation and other fixes

39 files changed, 187 insertions(+), 186 deletions(-)

doc/langref.html.in+2-2
......@@ -8171,7 +8171,7 @@ fn func(y: *i32) void {
81718171 {#header_open|@mulAdd#}
81728172 <pre>{#syntax#}@mulAdd(comptime T: type, a: T, b: T, c: T) T{#endsyntax#}</pre>
81738173 <p>
8174 Fused multiply add, similar to {#syntax#}(a * b) + c{#endsyntax#}, except
8174 Fused multiply-add, similar to {#syntax#}(a * b) + c{#endsyntax#}, except
81758175 only rounds once, and is thus more accurate.
81768176 </p>
81778177 <p>
......@@ -9306,7 +9306,7 @@ pub const FloatMode = enum {
93069306 <li>Assume the arguments and result are not +/-Inf. Optimizations are required to retain defined behavior over +/-Inf, but the value of the result is undefined.</li>
93079307 <li>Treat the sign of a zero argument or result as insignificant.</li>
93089308 <li>Use the reciprocal of an argument rather than perform division.</li>
9309 <li>Perform floating-point contraction (e.g. fusing a multiply followed by an addition into a fused multiply-and-add).</li>
9309 <li>Perform floating-point contraction (e.g. fusing a multiply followed by an addition into a fused multiply-add).</li>
93109310 <li>Perform algebraically equivalent transformations that may change results in floating point (e.g. reassociate).</li>
93119311 </ul>
93129312 This is equivalent to <code>-ffast-math</code> in GCC.
lib/std/bit_set.zig+3-3
......@@ -23,7 +23,7 @@
2323//! size. The interfaces of these two types match exactly, except for fields.
2424//!
2525//! DynamicBitSet:
26//! A bit set with runtime known size, backed by an allocated slice
26//! A bit set with runtime-known size, backed by an allocated slice
2727//! of usize.
2828//!
2929//! DynamicBitSetUnmanaged:
......@@ -515,7 +515,7 @@ pub fn ArrayBitSet(comptime MaskIntType: type, comptime size: usize) type {
515515 };
516516}
517517
518/// A bit set with runtime known size, backed by an allocated slice
518/// A bit set with runtime-known size, backed by an allocated slice
519519/// of usize. The allocator must be tracked externally by the user.
520520pub const DynamicBitSetUnmanaged = struct {
521521 const Self = @This();
......@@ -843,7 +843,7 @@ pub const DynamicBitSetUnmanaged = struct {
843843 }
844844};
845845
846/// A bit set with runtime known size, backed by an allocated slice
846/// A bit set with runtime-known size, backed by an allocated slice
847847/// of usize. Thin wrapper around DynamicBitSetUnmanaged which keeps
848848/// track of the allocator instance.
849849pub const DynamicBitSet = struct {
lib/std/enums.zig+1-1
......@@ -696,7 +696,7 @@ pub fn IndexedArray(comptime I: type, comptime V: type, comptime Ext: fn (type)
696696}
697697
698698/// Verifies that a type is a valid Indexer, providing a helpful
699/// compile error if not. An Indexer maps a comptime known set
699/// compile error if not. An Indexer maps a comptime-known set
700700/// of keys to a dense set of zero-based indices.
701701/// The indexer interface must look like this:
702702/// ```
lib/std/fmt.zig+1-1
......@@ -29,7 +29,7 @@ pub const FormatOptions = struct {
2929/// If `writer` returns an error, the error is returned from `format` and
3030/// `writer` is not called again.
3131///
32/// The format string must be comptime known and may contain placeholders following
32/// The format string must be comptime-known and may contain placeholders following
3333/// this format:
3434/// `{[argument][specifier]:[fill][alignment][width].[precision]}`
3535///
lib/std/math.zig+4-3
......@@ -786,14 +786,14 @@ fn testOverflow() !void {
786786 try testing.expect((shlExact(i32, 0b11, 4) catch unreachable) == 0b110000);
787787}
788788
789/// Returns the absolute value of x, where x is a value of an integer
790/// type.
789/// Returns the absolute value of x, where x is a value of a signed integer type.
790/// See also: `absCast`
791791pub fn absInt(x: anytype) !@TypeOf(x) {
792792 const T = @TypeOf(x);
793793 comptime assert(@typeInfo(T) == .Int); // must pass an integer to absInt
794794 comptime assert(@typeInfo(T).Int.signedness == .signed); // must pass a signed integer to absInt
795795
796 if (x == minInt(@TypeOf(x))) {
796 if (x == minInt(T)) {
797797 return error.Overflow;
798798 } else {
799799 @setRuntimeSafety(false);
......@@ -1001,6 +1001,7 @@ pub inline fn fabs(value: anytype) @TypeOf(value) {
10011001
10021002/// Returns the absolute value of the integer parameter.
10031003/// Result is an unsigned integer.
1004/// See also: `absInt`
10041005pub fn absCast(x: anytype) switch (@typeInfo(@TypeOf(x))) {
10051006 .ComptimeInt => comptime_int,
10061007 .Int => |int_info| std.meta.Int(.unsigned, int_info.bits),
lib/std/testing.zig+4-4
......@@ -213,8 +213,8 @@ pub fn expectFmt(expected: []const u8, comptime template: []const u8, args: anyt
213213/// This function is intended to be used only in tests. When the actual value is
214214/// not approximately equal to the expected value, prints diagnostics to stderr
215215/// to show exactly how they are not equal, then returns a test failure error.
216/// See `math.approxEqAbs` for more informations on the tolerance parameter.
217/// The types must be floating point.
216/// See `math.approxEqAbs` for more information on the tolerance parameter.
217/// The types must be floating-point.
218218pub fn expectApproxEqAbs(expected: anytype, actual: @TypeOf(expected), tolerance: @TypeOf(expected)) !void {
219219 const T = @TypeOf(expected);
220220
......@@ -245,8 +245,8 @@ test "expectApproxEqAbs" {
245245/// This function is intended to be used only in tests. When the actual value is
246246/// not approximately equal to the expected value, prints diagnostics to stderr
247247/// to show exactly how they are not equal, then returns a test failure error.
248/// See `math.approxEqRel` for more informations on the tolerance parameter.
249/// The types must be floating point.
248/// See `math.approxEqRel` for more information on the tolerance parameter.
249/// The types must be floating-point.
250250pub fn expectApproxEqRel(expected: anytype, actual: @TypeOf(expected), tolerance: @TypeOf(expected)) !void {
251251 const T = @TypeOf(expected);
252252
src/Module.zig+2-2
......@@ -3494,7 +3494,7 @@ fn freeExportList(gpa: Allocator, export_list: []*Export) void {
34943494const data_has_safety_tag = @sizeOf(Zir.Inst.Data) != 8;
34953495// TODO This is taking advantage of matching stage1 debug union layout.
34963496// We need a better language feature for initializing a union with
3497// a runtime known tag.
3497// a runtime-known tag.
34983498const Stage1DataLayout = extern struct {
34993499 data: [8]u8 align(@alignOf(Zir.Inst.Data)),
35003500 safety_tag: u8,
......@@ -4594,7 +4594,7 @@ fn semaDecl(mod: *Module, decl_index: Decl.Index) !bool {
45944594 const decl_linksection: ?[*:0]const u8 = blk: {
45954595 const linksection_ref = decl.zirLinksectionRef();
45964596 if (linksection_ref == .none) break :blk null;
4597 const bytes = try sema.resolveConstString(&block_scope, section_src, linksection_ref, "linksection must be comptime known");
4597 const bytes = try sema.resolveConstString(&block_scope, section_src, linksection_ref, "linksection must be comptime-known");
45984598 if (mem.indexOfScalar(u8, bytes, 0) != null) {
45994599 return sema.fail(&block_scope, section_src, "linksection cannot contain null bytes", .{});
46004600 } else if (bytes.len == 0) {
src/Sema.zig+116-116
......@@ -50,7 +50,7 @@ comptime_break_inst: Zir.Inst.Index = undefined,
5050src: LazySrcLoc = .{ .token_offset = 0 },
5151decl_val_table: std.AutoHashMapUnmanaged(Decl.Index, Air.Inst.Ref) = .{},
5252/// When doing a generic function instantiation, this array collects a
53/// `Value` object for each parameter that is comptime known and thus elided
53/// `Value` object for each parameter that is comptime-known and thus elided
5454/// from the generated function. This memory is allocated by a parent `Sema` and
5555/// owned by the values arena of the Sema owner_decl.
5656comptime_args: []TypedValue = &.{},
......@@ -1381,7 +1381,7 @@ fn analyzeBodyInner(
13811381 const extra = sema.code.extraData(Zir.Inst.CondBr, inst_data.payload_index);
13821382 const then_body = sema.code.extra[extra.end..][0..extra.data.then_body_len];
13831383 const else_body = sema.code.extra[extra.end + then_body.len ..][0..extra.data.else_body_len];
1384 const cond = try sema.resolveInstConst(block, cond_src, extra.data.condition, "condition in comptime branch must be comptime known");
1384 const cond = try sema.resolveInstConst(block, cond_src, extra.data.condition, "condition in comptime branch must be comptime-known");
13851385 const inline_body = if (cond.val.toBool()) then_body else else_body;
13861386
13871387 try sema.maybeErrorUnwrapCondbr(block, inline_body, extra.data.condition, cond_src);
......@@ -1399,7 +1399,7 @@ fn analyzeBodyInner(
13991399 const extra = sema.code.extraData(Zir.Inst.CondBr, inst_data.payload_index);
14001400 const then_body = sema.code.extra[extra.end..][0..extra.data.then_body_len];
14011401 const else_body = sema.code.extra[extra.end + then_body.len ..][0..extra.data.else_body_len];
1402 const cond = try sema.resolveInstConst(block, cond_src, extra.data.condition, "condition in comptime branch must be comptime known");
1402 const cond = try sema.resolveInstConst(block, cond_src, extra.data.condition, "condition in comptime branch must be comptime-known");
14031403 const inline_body = if (cond.val.toBool()) then_body else else_body;
14041404 const old_runtime_index = block.runtime_index;
14051405 defer block.runtime_index = old_runtime_index;
......@@ -1421,7 +1421,7 @@ fn analyzeBodyInner(
14211421 const err_union = try sema.resolveInst(extra.data.operand);
14221422 const is_non_err = try sema.analyzeIsNonErrComptimeOnly(block, operand_src, err_union);
14231423 assert(is_non_err != .none);
1424 const is_non_err_tv = try sema.resolveInstConst(block, operand_src, is_non_err, "try operand inside comptime block must be comptime known");
1424 const is_non_err_tv = try sema.resolveInstConst(block, operand_src, is_non_err, "try operand inside comptime block must be comptime-known");
14251425 if (is_non_err_tv.val.toBool()) {
14261426 const err_union_ty = sema.typeOf(err_union);
14271427 break :blk try sema.analyzeErrUnionPayload(block, src, err_union_ty, err_union, operand_src, false);
......@@ -1477,7 +1477,7 @@ fn analyzeBodyInner(
14771477 const err_union = try sema.analyzeLoad(block, src, operand, operand_src);
14781478 const is_non_err = try sema.analyzeIsNonErrComptimeOnly(block, operand_src, err_union);
14791479 assert(is_non_err != .none);
1480 const is_non_err_tv = try sema.resolveInstConst(block, operand_src, is_non_err, "try operand inside comptime block must be comptime known");
1480 const is_non_err_tv = try sema.resolveInstConst(block, operand_src, is_non_err, "try operand inside comptime block must be comptime-known");
14811481 if (is_non_err_tv.val.toBool()) {
14821482 break :blk try sema.analyzeErrUnionPayloadPtr(block, src, operand, false, false);
14831483 }
......@@ -1622,7 +1622,7 @@ fn analyzeAsType(
16221622) !Type {
16231623 const wanted_type = Type.initTag(.@"type");
16241624 const coerced_inst = try sema.coerce(block, wanted_type, air_inst, src);
1625 const val = try sema.resolveConstValue(block, src, coerced_inst, "types must be comptime known");
1625 const val = try sema.resolveConstValue(block, src, coerced_inst, "types must be comptime-known");
16261626 var buffer: Value.ToTypeBuffer = undefined;
16271627 const ty = val.toType(&buffer);
16281628 return ty.copy(sema.arena);
......@@ -2067,7 +2067,7 @@ fn analyzeAsAlign(
20672067 src: LazySrcLoc,
20682068 air_ref: Air.Inst.Ref,
20692069) !u32 {
2070 const alignment_big = try sema.analyzeAsInt(block, src, air_ref, align_ty, "alignment must be comptime known");
2070 const alignment_big = try sema.analyzeAsInt(block, src, air_ref, align_ty, "alignment must be comptime-known");
20712071 const alignment = @intCast(u32, alignment_big); // We coerce to u16 in the prev line.
20722072 try sema.validateAlign(block, src, alignment);
20732073 return alignment;
......@@ -2741,7 +2741,7 @@ fn zirEnumDecl(
27412741 // TODO: if we need to report an error here, use a source location
27422742 // that points to this default value expression rather than the struct.
27432743 // But only resolve the source location if we need to emit a compile error.
2744 const tag_val = (try sema.resolveInstConst(block, src, tag_val_ref, "enum tag value must be comptime known")).val;
2744 const tag_val = (try sema.resolveInstConst(block, src, tag_val_ref, "enum tag value must be comptime-known")).val;
27452745 last_tag_val = tag_val;
27462746 const copied_tag_val = try tag_val.copy(decl_arena_allocator);
27472747 const gop_val = enum_obj.values.getOrPutAssumeCapacityContext(copied_tag_val, .{
......@@ -3259,7 +3259,7 @@ fn zirMakePtrConst(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileErro
32593259 var ptr_info = alloc_ty.ptrInfo().data;
32603260 const elem_ty = ptr_info.pointee_type;
32613261
3262 // Detect if all stores to an `.alloc` were comptime known.
3262 // Detect if all stores to an `.alloc` were comptime-known.
32633263 ct: {
32643264 var search_index: usize = block.instructions.items.len;
32653265 const air_tags = sema.air_instructions.items(.tag);
......@@ -3476,7 +3476,7 @@ fn zirResolveInferredAlloc(sema: *Sema, block: *Block, inst: Zir.Inst.Index) Com
34763476 if (var_is_mut) {
34773477 try sema.validateVarType(block, ty_src, final_elem_ty, false);
34783478 } else ct: {
3479 // Detect if the value is comptime known. In such case, the
3479 // Detect if the value is comptime-known. In such case, the
34803480 // last 3 AIR instructions of the block will look like this:
34813481 //
34823482 // %a = constant
......@@ -4383,7 +4383,7 @@ fn zirValidateDeref(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileErr
43834383 const msg = try sema.errMsg(
43844384 block,
43854385 src,
4386 "values of type '{}' must be comptime known, but operand value is runtime known",
4386 "values of type '{}' must be comptime-known, but operand value is runtime-known",
43874387 .{elem_ty.fmt(sema.mod)},
43884388 );
43894389 errdefer msg.destroy(sema.gpa);
......@@ -4597,13 +4597,13 @@ fn storeToInferredAllocComptime(
45974597 return;
45984598 }
45994599
4600 return sema.failWithNeededComptime(block, src, "value being stored to a comptime variable must be comptime known");
4600 return sema.failWithNeededComptime(block, src, "value being stored to a comptime variable must be comptime-known");
46014601}
46024602
46034603fn zirSetEvalBranchQuota(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!void {
46044604 const inst_data = sema.code.instructions.items(.data)[inst].un_node;
46054605 const src = inst_data.src();
4606 const quota = @intCast(u32, try sema.resolveInt(block, src, inst_data.operand, Type.u32, "eval branch quota must be comptime known"));
4606 const quota = @intCast(u32, try sema.resolveInt(block, src, inst_data.operand, Type.u32, "eval branch quota must be comptime-known"));
46074607 sema.branch_quota = @maximum(sema.branch_quota, quota);
46084608}
46094609
......@@ -4756,7 +4756,7 @@ fn zirCompileError(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileErro
47564756 const inst_data = sema.code.instructions.items(.data)[inst].un_node;
47574757 const src = inst_data.src();
47584758 const operand_src: LazySrcLoc = .{ .node_offset_builtin_call_arg0 = inst_data.src_node };
4759 const msg = try sema.resolveConstString(block, operand_src, inst_data.operand, "compile error string must be comptime known");
4759 const msg = try sema.resolveConstString(block, operand_src, inst_data.operand, "compile error string must be comptime-known");
47604760 return sema.fail(block, src, "{s}", .{msg});
47614761}
47624762
......@@ -5096,7 +5096,7 @@ fn analyzeBlockBody(
50965096 const valid_rt = try sema.validateRunTimeType(child_block, type_src, resolved_ty, false);
50975097 if (!valid_rt) {
50985098 const msg = msg: {
5099 const msg = try sema.errMsg(child_block, type_src, "value with comptime only type '{}' depends on runtime control flow", .{resolved_ty.fmt(mod)});
5099 const msg = try sema.errMsg(child_block, type_src, "value with comptime-only type '{}' depends on runtime control flow", .{resolved_ty.fmt(mod)});
51005100 errdefer msg.destroy(sema.gpa);
51015101
51025102 const runtime_src = child_block.runtime_cond orelse child_block.runtime_loop.?;
......@@ -5206,7 +5206,7 @@ fn zirExportValue(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError
52065206 const src = inst_data.src();
52075207 const operand_src: LazySrcLoc = .{ .node_offset_builtin_call_arg0 = inst_data.src_node };
52085208 const options_src: LazySrcLoc = .{ .node_offset_builtin_call_arg1 = inst_data.src_node };
5209 const operand = try sema.resolveInstConst(block, operand_src, extra.operand, "export target must be comptime known");
5209 const operand = try sema.resolveInstConst(block, operand_src, extra.operand, "export target must be comptime-known");
52105210 const options = sema.resolveExportOptions(block, .unneeded, extra.options) catch |err| switch (err) {
52115211 error.NeededSourceLocation => {
52125212 _ = try sema.resolveExportOptions(block, options_src, extra.options);
......@@ -5347,7 +5347,7 @@ fn zirSetAlignStack(sema: *Sema, block: *Block, extended: Zir.Inst.Extended.Inst
53475347fn zirSetCold(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!void {
53485348 const inst_data = sema.code.instructions.items(.data)[inst].un_node;
53495349 const operand_src: LazySrcLoc = .{ .node_offset_builtin_call_arg0 = inst_data.src_node };
5350 const is_cold = try sema.resolveConstBool(block, operand_src, inst_data.operand, "operand to @setCold must be comptime known");
5350 const is_cold = try sema.resolveConstBool(block, operand_src, inst_data.operand, "operand to @setCold must be comptime-known");
53515351 const func = sema.func orelse return; // does nothing outside a function
53525352 func.is_cold = is_cold;
53535353}
......@@ -5355,13 +5355,13 @@ fn zirSetCold(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!voi
53555355fn zirSetFloatMode(sema: *Sema, block: *Block, extended: Zir.Inst.Extended.InstData) CompileError!void {
53565356 const extra = sema.code.extraData(Zir.Inst.UnNode, extended.operand).data;
53575357 const src: LazySrcLoc = .{ .node_offset_builtin_call_arg0 = extra.node };
5358 block.float_mode = try sema.resolveBuiltinEnum(block, src, extra.operand, "FloatMode", "operand to @setFloatMode must be comptime known");
5358 block.float_mode = try sema.resolveBuiltinEnum(block, src, extra.operand, "FloatMode", "operand to @setFloatMode must be comptime-known");
53595359}
53605360
53615361fn zirSetRuntimeSafety(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!void {
53625362 const inst_data = sema.code.instructions.items(.data)[inst].un_node;
53635363 const operand_src: LazySrcLoc = .{ .node_offset_builtin_call_arg0 = inst_data.src_node };
5364 block.want_safety = try sema.resolveConstBool(block, operand_src, inst_data.operand, "operand to @setRuntimeSafety must be comptime known");
5364 block.want_safety = try sema.resolveConstBool(block, operand_src, inst_data.operand, "operand to @setRuntimeSafety must be comptime-known");
53655365}
53665366
53675367fn zirFence(sema: *Sema, block: *Block, extended: Zir.Inst.Extended.InstData) CompileError!void {
......@@ -5369,7 +5369,7 @@ fn zirFence(sema: *Sema, block: *Block, extended: Zir.Inst.Extended.InstData) Co
53695369
53705370 const extra = sema.code.extraData(Zir.Inst.UnNode, extended.operand).data;
53715371 const order_src: LazySrcLoc = .{ .node_offset_builtin_call_arg0 = extra.node };
5372 const order = try sema.resolveAtomicOrder(block, order_src, extra.operand, "atomic order of @fence must be comptime known");
5372 const order = try sema.resolveAtomicOrder(block, order_src, extra.operand, "atomic order of @fence must be comptime-known");
53735373
53745374 if (@enumToInt(order) < @enumToInt(std.builtin.AtomicOrder.Acquire)) {
53755375 return sema.fail(block, order_src, "atomic ordering must be Acquire or stricter", .{});
......@@ -5861,12 +5861,12 @@ fn addComptimeReturnTypeNote(
58615861 break :blk func_src.toSrcLoc(src_decl);
58625862 };
58635863 if (return_ty.tag() == .generic_poison) {
5864 return sema.mod.errNoteNonLazy(src_loc, parent, "generic function is instantiated with a comptime only return type", .{});
5864 return sema.mod.errNoteNonLazy(src_loc, parent, "generic function is instantiated with a comptime-only return type", .{});
58655865 }
58665866 try sema.mod.errNoteNonLazy(
58675867 src_loc,
58685868 parent,
5869 "function is being called at comptime because it returns a comptime only type '{}'",
5869 "function is being called at comptime because it returns a comptime-only type '{}'",
58705870 .{return_ty.fmt(sema.mod)},
58715871 );
58725872 try sema.explainWhyTypeIsComptime(block, func_src, parent, src_loc, return_ty);
......@@ -6006,7 +6006,7 @@ fn analyzeCall(
60066006 }
60076007
60086008 const result: Air.Inst.Ref = if (is_inline_call) res: {
6009 const func_val = sema.resolveConstValue(block, func_src, func, "function being called at comptime must be comptime known") catch |err| {
6009 const func_val = sema.resolveConstValue(block, func_src, func, "function being called at comptime must be comptime-known") catch |err| {
60106010 if (err == error.AnalysisFail and sema.err != null) {
60116011 try sema.addComptimeReturnTypeNote(block, func, func_src, func_ty_info.return_type, sema.err.?, comptime_only_ret_ty);
60126012 }
......@@ -6404,7 +6404,7 @@ fn analyzeInlineCallArg(
64046404 new_fn_info.param_types[arg_i.*] = param_ty;
64056405 const uncasted_arg = uncasted_args[arg_i.*];
64066406 if (try sema.typeRequiresComptime(param_ty)) {
6407 _ = sema.resolveConstMaybeUndefVal(arg_block, arg_src, uncasted_arg, "argument to parameter with comptime only type must be comptime known") catch |err| {
6407 _ = sema.resolveConstMaybeUndefVal(arg_block, arg_src, uncasted_arg, "argument to parameter with comptime-only type must be comptime-known") catch |err| {
64086408 if (err == error.AnalysisFail and sema.err != null) {
64096409 try sema.addComptimeReturnTypeNote(arg_block, func, func_src, ret_ty, sema.err.?, comptime_only_ret_ty);
64106410 }
......@@ -6415,7 +6415,7 @@ fn analyzeInlineCallArg(
64156415 try sema.inst_map.putNoClobber(sema.gpa, inst, casted_arg);
64166416
64176417 if (is_comptime_call) {
6418 const arg_val = sema.resolveConstMaybeUndefVal(arg_block, arg_src, casted_arg, "argument to function being called at comptime must be comptime known") catch |err| {
6418 const arg_val = sema.resolveConstMaybeUndefVal(arg_block, arg_src, casted_arg, "argument to function being called at comptime must be comptime-known") catch |err| {
64196419 if (err == error.AnalysisFail and sema.err != null) {
64206420 try sema.addComptimeReturnTypeNote(arg_block, func, func_src, ret_ty, sema.err.?, comptime_only_ret_ty);
64216421 }
......@@ -6450,7 +6450,7 @@ fn analyzeInlineCallArg(
64506450 try sema.inst_map.putNoClobber(sema.gpa, inst, uncasted_arg);
64516451
64526452 if (is_comptime_call) {
6453 const arg_val = sema.resolveConstMaybeUndefVal(arg_block, arg_src, uncasted_arg, "argument to function being called at comptime must be comptime known") catch |err| {
6453 const arg_val = sema.resolveConstMaybeUndefVal(arg_block, arg_src, uncasted_arg, "argument to function being called at comptime must be comptime-known") catch |err| {
64546454 if (err == error.AnalysisFail and sema.err != null) {
64556455 try sema.addComptimeReturnTypeNote(arg_block, func, func_src, ret_ty, sema.err.?, comptime_only_ret_ty);
64566456 }
......@@ -6536,7 +6536,7 @@ fn instantiateGenericCall(
65366536 const mod = sema.mod;
65376537 const gpa = sema.gpa;
65386538
6539 const func_val = try sema.resolveConstValue(block, func_src, func, "generic function being called must be comptime known");
6539 const func_val = try sema.resolveConstValue(block, func_src, func, "generic function being called must be comptime-known");
65406540 const module_fn = switch (func_val.tag()) {
65416541 .function => func_val.castTag(.function).?.data,
65426542 .decl_ref => mod.declPtr(func_val.castTag(.decl_ref).?.data).val.castTag(.function).?.data,
......@@ -7030,7 +7030,7 @@ fn zirVectorType(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!
70307030 const elem_type_src: LazySrcLoc = .{ .node_offset_builtin_call_arg0 = inst_data.src_node };
70317031 const len_src: LazySrcLoc = .{ .node_offset_builtin_call_arg1 = inst_data.src_node };
70327032 const extra = sema.code.extraData(Zir.Inst.Bin, inst_data.payload_index).data;
7033 const len = try sema.resolveInt(block, len_src, extra.lhs, Type.u32, "vector length must be comptime known");
7033 const len = try sema.resolveInt(block, len_src, extra.lhs, Type.u32, "vector length must be comptime-known");
70347034 const elem_type = try sema.resolveType(block, elem_type_src, extra.rhs);
70357035 try sema.checkVectorElemType(block, elem_type_src, elem_type);
70367036 const vector_type = try Type.Tag.vector.create(sema.arena, .{
......@@ -7048,7 +7048,7 @@ fn zirArrayType(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!A
70487048 const extra = sema.code.extraData(Zir.Inst.Bin, inst_data.payload_index).data;
70497049 const len_src: LazySrcLoc = .{ .node_offset_array_type_len = inst_data.src_node };
70507050 const elem_src: LazySrcLoc = .{ .node_offset_array_type_elem = inst_data.src_node };
7051 const len = try sema.resolveInt(block, len_src, extra.lhs, Type.usize, "array length must be comptime known");
7051 const len = try sema.resolveInt(block, len_src, extra.lhs, Type.usize, "array length must be comptime-known");
70527052 const elem_type = try sema.resolveType(block, elem_src, extra.rhs);
70537053 const array_ty = try Type.array(sema.arena, len, null, elem_type, sema.mod);
70547054
......@@ -7064,11 +7064,11 @@ fn zirArrayTypeSentinel(sema: *Sema, block: *Block, inst: Zir.Inst.Index) Compil
70647064 const len_src: LazySrcLoc = .{ .node_offset_array_type_len = inst_data.src_node };
70657065 const sentinel_src: LazySrcLoc = .{ .node_offset_array_type_sentinel = inst_data.src_node };
70667066 const elem_src: LazySrcLoc = .{ .node_offset_array_type_elem = inst_data.src_node };
7067 const len = try sema.resolveInt(block, len_src, extra.len, Type.usize, "array length must be comptime known");
7067 const len = try sema.resolveInt(block, len_src, extra.len, Type.usize, "array length must be comptime-known");
70687068 const elem_type = try sema.resolveType(block, elem_src, extra.elem_type);
70697069 const uncasted_sentinel = try sema.resolveInst(extra.sentinel);
70707070 const sentinel = try sema.coerce(block, elem_type, uncasted_sentinel, sentinel_src);
7071 const sentinel_val = try sema.resolveConstValue(block, sentinel_src, sentinel, "array sentinel value must be comptime known");
7071 const sentinel_val = try sema.resolveConstValue(block, sentinel_src, sentinel, "array sentinel value must be comptime-known");
70727072 const array_ty = try Type.array(sema.arena, len, sentinel_val, elem_type, sema.mod);
70737073
70747074 return sema.addType(array_ty);
......@@ -7752,7 +7752,7 @@ fn zirFunc(
77527752 const ret_ty_body = sema.code.extra[extra_index..][0..extra.data.ret_body_len];
77537753 extra_index += ret_ty_body.len;
77547754
7755 const ret_ty_val = try sema.resolveGenericBody(block, ret_ty_src, ret_ty_body, inst, Type.type, "return type must be comptime known");
7755 const ret_ty_val = try sema.resolveGenericBody(block, ret_ty_src, ret_ty_body, inst, Type.type, "return type must be comptime-known");
77567756 var buffer: Value.ToTypeBuffer = undefined;
77577757 break :blk try ret_ty_val.toType(&buffer).copy(sema.arena);
77587758 },
......@@ -8075,7 +8075,7 @@ fn funcCommon(
80758075 return sema.failWithOwnedErrorMsg(msg);
80768076 }
80778077
8078 // If the return type is comptime only but not dependent on parameters then all parameter types also need to be comptime
8078 // If the return type is comptime-only but not dependent on parameters then all parameter types also need to be comptime
80798079 if (!sema.is_generic_instantiation and has_body and ret_ty_requires_comptime) comptime_check: {
80808080 for (block.params.items) |param| {
80818081 if (!param.is_comptime) break;
......@@ -8084,7 +8084,7 @@ fn funcCommon(
80848084 const msg = try sema.errMsg(
80858085 block,
80868086 ret_ty_src,
8087 "function with comptime only return type '{}' requires all parameters to be comptime",
8087 "function with comptime-only return type '{}' requires all parameters to be comptime",
80888088 .{return_type.fmt(sema.mod)},
80898089 );
80908090 try sema.explainWhyTypeIsComptime(block, ret_ty_src, msg, ret_ty_src.toSrcLoc(sema.owner_decl), return_type);
......@@ -8586,7 +8586,7 @@ fn zirFieldValNamed(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileErr
85868586 const field_name_src: LazySrcLoc = .{ .node_offset_builtin_call_arg1 = inst_data.src_node };
85878587 const extra = sema.code.extraData(Zir.Inst.FieldNamed, inst_data.payload_index).data;
85888588 const object = try sema.resolveInst(extra.lhs);
8589 const field_name = try sema.resolveConstString(block, field_name_src, extra.field_name, "field name must be comptime known");
8589 const field_name = try sema.resolveConstString(block, field_name_src, extra.field_name, "field name must be comptime-known");
85908590 return sema.fieldVal(block, src, object, field_name, field_name_src);
85918591}
85928592
......@@ -8599,7 +8599,7 @@ fn zirFieldPtrNamed(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileErr
85998599 const field_name_src: LazySrcLoc = .{ .node_offset_builtin_call_arg1 = inst_data.src_node };
86008600 const extra = sema.code.extraData(Zir.Inst.FieldNamed, inst_data.payload_index).data;
86018601 const object_ptr = try sema.resolveInst(extra.lhs);
8602 const field_name = try sema.resolveConstString(block, field_name_src, extra.field_name, "field name must be comptime known");
8602 const field_name = try sema.resolveConstString(block, field_name_src, extra.field_name, "field name must be comptime-known");
86038603 return sema.fieldPtr(block, src, object_ptr, field_name, field_name_src, false);
86048604}
86058605
......@@ -8611,7 +8611,7 @@ fn zirFieldCallBindNamed(sema: *Sema, block: *Block, extended: Zir.Inst.Extended
86118611 const src = LazySrcLoc.nodeOffset(extra.node);
86128612 const field_name_src: LazySrcLoc = .{ .node_offset_builtin_call_arg1 = extra.node };
86138613 const object_ptr = try sema.resolveInst(extra.lhs);
8614 const field_name = try sema.resolveConstString(block, field_name_src, extra.field_name, "field name must be comptime known");
8614 const field_name = try sema.resolveConstString(block, field_name_src, extra.field_name, "field name must be comptime-known");
86158615 return sema.fieldCallBind(block, src, object_ptr, field_name, field_name_src);
86168616}
86178617
......@@ -10647,7 +10647,7 @@ fn resolveSwitchItemVal(
1064710647 const src = switch_prong_src.resolve(sema.gpa, sema.mod.declPtr(block.src_decl), switch_node_offset, range_expand);
1064810648 return TypedValue{
1064910649 .ty = item_ty,
10650 .val = try sema.resolveConstValue(block, src, item, "switch prong values must be comptime known"),
10650 .val = try sema.resolveConstValue(block, src, item, "switch prong values must be comptime-known"),
1065110651 };
1065210652 },
1065310653 else => |e| return e,
......@@ -10936,7 +10936,7 @@ fn zirHasField(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai
1093610936 const ty_src: LazySrcLoc = .{ .node_offset_builtin_call_arg0 = inst_data.src_node };
1093710937 const name_src: LazySrcLoc = .{ .node_offset_builtin_call_arg1 = inst_data.src_node };
1093810938 const unresolved_ty = try sema.resolveType(block, ty_src, extra.lhs);
10939 const field_name = try sema.resolveConstString(block, name_src, extra.rhs, "field name must be comptime known");
10939 const field_name = try sema.resolveConstString(block, name_src, extra.rhs, "field name must be comptime-known");
1094010940 const ty = try sema.resolveTypeFields(block, ty_src, unresolved_ty);
1094110941
1094210942 const has_field = hf: {
......@@ -10978,7 +10978,7 @@ fn zirHasDecl(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air
1097810978 const lhs_src: LazySrcLoc = .{ .node_offset_builtin_call_arg0 = inst_data.src_node };
1097910979 const rhs_src: LazySrcLoc = .{ .node_offset_builtin_call_arg1 = inst_data.src_node };
1098010980 const container_type = try sema.resolveType(block, lhs_src, extra.lhs);
10981 const decl_name = try sema.resolveConstString(block, rhs_src, extra.rhs, "decl name must be comptime known");
10981 const decl_name = try sema.resolveConstString(block, rhs_src, extra.rhs, "decl name must be comptime-known");
1098210982
1098310983 try checkNamespaceType(sema, block, lhs_src, container_type);
1098410984
......@@ -11042,7 +11042,7 @@ fn zirEmbedFile(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!A
1104211042 const mod = sema.mod;
1104311043 const inst_data = sema.code.instructions.items(.data)[inst].un_node;
1104411044 const operand_src: LazySrcLoc = .{ .node_offset_builtin_call_arg0 = inst_data.src_node };
11045 const name = try sema.resolveConstString(block, operand_src, inst_data.operand, "file path name must be comptime known");
11045 const name = try sema.resolveConstString(block, operand_src, inst_data.operand, "file path name must be comptime-known");
1104611046
1104711047 const embed_file = mod.embedFile(block.getFileScope(), name) catch |err| switch (err) {
1104811048 error.ImportOutsidePkgPath => {
......@@ -11157,7 +11157,7 @@ fn zirShl(
1115711157 if (lhs_val.isUndef()) return sema.addConstUndef(lhs_ty);
1115811158 const rhs_val = maybe_rhs_val orelse {
1115911159 if (scalar_ty.zigTypeTag() == .ComptimeInt) {
11160 return sema.fail(block, src, "LHS of shift must be a fixed-width integer type, or RHS must be a comptime known", .{});
11160 return sema.fail(block, src, "LHS of shift must be a fixed-width integer type, or RHS must be comptime-known", .{});
1116111161 }
1116211162 break :rs rhs_src;
1116311163 };
......@@ -11339,7 +11339,7 @@ fn zirShr(
1133911339 } else rhs_src;
1134011340
1134111341 if (maybe_rhs_val == null and scalar_ty.zigTypeTag() == .ComptimeInt) {
11342 return sema.fail(block, src, "LHS of shift must be a fixed-width integer type, or RHS must be a comptime known", .{});
11342 return sema.fail(block, src, "LHS of shift must be a fixed-width integer type, or RHS must be comptime-known", .{});
1134311343 }
1134411344
1134511345 try sema.requireRuntimeBlock(block, src, runtime_src);
......@@ -11609,8 +11609,8 @@ fn zirArrayCat(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai
1160911609 const rhs_sent = try sema.addConstant(rhs_info.elem_type, rhs_sent_val);
1161011610 const lhs_sent_casted = try sema.coerce(block, resolved_elem_ty, lhs_sent, lhs_src);
1161111611 const rhs_sent_casted = try sema.coerce(block, resolved_elem_ty, rhs_sent, rhs_src);
11612 const lhs_sent_casted_val = try sema.resolveConstValue(block, lhs_src, lhs_sent_casted, "array sentinel value must be comptime known");
11613 const rhs_sent_casted_val = try sema.resolveConstValue(block, rhs_src, rhs_sent_casted, "array sentinel value must be comptime known");
11612 const lhs_sent_casted_val = try sema.resolveConstValue(block, lhs_src, lhs_sent_casted, "array sentinel value must be comptime-known");
11613 const rhs_sent_casted_val = try sema.resolveConstValue(block, rhs_src, rhs_sent_casted, "array sentinel value must be comptime-known");
1161411614 if (try sema.valuesEqual(block, src, lhs_sent_casted_val, rhs_sent_casted_val, resolved_elem_ty)) {
1161511615 break :s lhs_sent_casted_val;
1161611616 } else {
......@@ -11618,14 +11618,14 @@ fn zirArrayCat(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai
1161811618 }
1161911619 } else {
1162011620 const lhs_sent_casted = try sema.coerce(block, resolved_elem_ty, lhs_sent, lhs_src);
11621 const lhs_sent_casted_val = try sema.resolveConstValue(block, lhs_src, lhs_sent_casted, "array sentinel value must be comptime known");
11621 const lhs_sent_casted_val = try sema.resolveConstValue(block, lhs_src, lhs_sent_casted, "array sentinel value must be comptime-known");
1162211622 break :s lhs_sent_casted_val;
1162311623 }
1162411624 } else {
1162511625 if (rhs_info.sentinel) |rhs_sent_val| {
1162611626 const rhs_sent = try sema.addConstant(rhs_info.elem_type, rhs_sent_val);
1162711627 const rhs_sent_casted = try sema.coerce(block, resolved_elem_ty, rhs_sent, rhs_src);
11628 const rhs_sent_casted_val = try sema.resolveConstValue(block, rhs_src, rhs_sent_casted, "array sentinel value must be comptime known");
11628 const rhs_sent_casted_val = try sema.resolveConstValue(block, rhs_src, rhs_sent_casted, "array sentinel value must be comptime-known");
1162911629 break :s rhs_sent_casted_val;
1163011630 } else {
1163111631 break :s null;
......@@ -11746,7 +11746,7 @@ fn getArrayCatInfo(sema: *Sema, block: *Block, src: LazySrcLoc, operand: Air.Ins
1174611746 // has a sentinel, and this code should compute the length based
1174711747 // on the sentinel value.
1174811748 .Slice, .Many => {
11749 const val = try sema.resolveConstValue(block, src, operand, "slice value being concatenated must be comptime known");
11749 const val = try sema.resolveConstValue(block, src, operand, "slice value being concatenated must be comptime-known");
1175011750 return Type.ArrayInfo{
1175111751 .elem_type = ptr_info.pointee_type,
1175211752 .sentinel = ptr_info.sentinel,
......@@ -11847,7 +11847,7 @@ fn zirArrayMul(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai
1184711847 const rhs_src: LazySrcLoc = .{ .node_offset_bin_rhs = inst_data.src_node };
1184811848
1184911849 // In `**` rhs must be comptime-known, but lhs can be runtime-known
11850 const factor = try sema.resolveInt(block, rhs_src, extra.rhs, Type.usize, "array multiplication factor must be comptime known");
11850 const factor = try sema.resolveInt(block, rhs_src, extra.rhs, Type.usize, "array multiplication factor must be comptime-known");
1185111851
1185211852 if (lhs_ty.isTuple()) {
1185311853 return sema.analyzeTupleMul(block, inst_data.src_node, lhs, factor);
......@@ -16223,14 +16223,14 @@ fn zirPtrType(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air
1622316223 const sentinel = if (inst_data.flags.has_sentinel) blk: {
1622416224 const ref = @intToEnum(Zir.Inst.Ref, sema.code.extra[extra_i]);
1622516225 extra_i += 1;
16226 break :blk (try sema.resolveInstConst(block, sentinel_src, ref, "pointer sentinel value must be comptime known")).val;
16226 break :blk (try sema.resolveInstConst(block, sentinel_src, ref, "pointer sentinel value must be comptime-known")).val;
1622716227 } else null;
1622816228
1622916229 const abi_align: u32 = if (inst_data.flags.has_align) blk: {
1623016230 const ref = @intToEnum(Zir.Inst.Ref, sema.code.extra[extra_i]);
1623116231 extra_i += 1;
1623216232 const coerced = try sema.coerce(block, Type.u32, try sema.resolveInst(ref), align_src);
16233 const val = try sema.resolveConstValue(block, align_src, coerced, "pointer alignment must be comptime known");
16233 const val = try sema.resolveConstValue(block, align_src, coerced, "pointer alignment must be comptime-known");
1623416234 // Check if this happens to be the lazy alignment of our element type, in
1623516235 // which case we can make this 0 without resolving it.
1623616236 if (val.castTag(.lazy_align)) |payload| {
......@@ -16252,14 +16252,14 @@ fn zirPtrType(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air
1625216252 const bit_offset = if (inst_data.flags.has_bit_range) blk: {
1625316253 const ref = @intToEnum(Zir.Inst.Ref, sema.code.extra[extra_i]);
1625416254 extra_i += 1;
16255 const bit_offset = try sema.resolveInt(block, bitoffset_src, ref, Type.u16, "pointer bit-offset must be comptime known");
16255 const bit_offset = try sema.resolveInt(block, bitoffset_src, ref, Type.u16, "pointer bit-offset must be comptime-known");
1625616256 break :blk @intCast(u16, bit_offset);
1625716257 } else 0;
1625816258
1625916259 const host_size: u16 = if (inst_data.flags.has_bit_range) blk: {
1626016260 const ref = @intToEnum(Zir.Inst.Ref, sema.code.extra[extra_i]);
1626116261 extra_i += 1;
16262 const host_size = try sema.resolveInt(block, hostsize_src, ref, Type.u16, "pointer host size must be comptime known");
16262 const host_size = try sema.resolveInt(block, hostsize_src, ref, Type.u16, "pointer host size must be comptime-known");
1626316263 break :blk @intCast(u16, host_size);
1626416264 } else 0;
1626516265
......@@ -16383,7 +16383,7 @@ fn zirUnionInit(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!A
1638316383 const init_src: LazySrcLoc = .{ .node_offset_builtin_call_arg2 = inst_data.src_node };
1638416384 const extra = sema.code.extraData(Zir.Inst.UnionInit, inst_data.payload_index).data;
1638516385 const union_ty = try sema.resolveType(block, ty_src, extra.union_type);
16386 const field_name = try sema.resolveConstString(block, field_src, extra.field_name, "name of field being initialized must be comptime known");
16386 const field_name = try sema.resolveConstString(block, field_src, extra.field_name, "name of field being initialized must be comptime-known");
1638716387 const init = try sema.resolveInst(extra.init);
1638816388 return sema.unionInit(block, init, init_src, union_ty, ty_src, field_name, field_src);
1638916389}
......@@ -16481,7 +16481,7 @@ fn zirStructInit(
1648116481 field_inits[field_index] = try sema.resolveInst(item.data.init);
1648216482 if (!is_packed) if (resolved_ty.structFieldValueComptime(field_index)) |default_value| {
1648316483 const init_val = (try sema.resolveMaybeUndefVal(block, field_src, field_inits[field_index])) orelse {
16484 return sema.failWithNeededComptime(block, field_src, "value stored in comptime field must be comptime known");
16484 return sema.failWithNeededComptime(block, field_src, "value stored in comptime field must be comptime-known");
1648516485 };
1648616486
1648716487 if (!init_val.eql(default_value, resolved_ty.structFieldType(field_index), sema.mod)) {
......@@ -16992,7 +16992,7 @@ fn zirFieldTypeRef(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileErro
1699216992 const ty_src = inst_data.src();
1699316993 const field_src = inst_data.src();
1699416994 const aggregate_ty = try sema.resolveType(block, ty_src, extra.container_type);
16995 const field_name = try sema.resolveConstString(block, field_src, extra.field_name, "field name must be comptime known");
16995 const field_name = try sema.resolveConstString(block, field_src, extra.field_name, "field name must be comptime-known");
1699616996 return sema.fieldType(block, aggregate_ty, field_name, field_src, ty_src);
1699716997}
1699816998
......@@ -17273,7 +17273,7 @@ fn zirReify(sema: *Sema, block: *Block, extended: Zir.Inst.Extended.InstData, in
1727317273 const uncasted_operand = try sema.resolveInst(extra.operand);
1727417274 const operand_src: LazySrcLoc = .{ .node_offset_builtin_call_arg0 = extra.node };
1727517275 const type_info = try sema.coerce(block, type_info_ty, uncasted_operand, operand_src);
17276 const val = try sema.resolveConstValue(block, operand_src, type_info, "operand to @Type must be comptime known");
17276 const val = try sema.resolveConstValue(block, operand_src, type_info, "operand to @Type must be comptime-known");
1727717277 const union_val = val.cast(Value.Payload.Union).?.data;
1727817278 const target = mod.getTarget();
1727917279 const tag_index = type_info_ty.unionTagFieldIndex(union_val.tag, mod).?;
......@@ -18213,7 +18213,7 @@ fn zirFloatToInt(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!
1821318213 const result_val = try sema.floatToInt(block, operand_src, val, operand_ty, dest_ty);
1821418214 return sema.addConstant(dest_ty, result_val);
1821518215 } else if (dest_ty.zigTypeTag() == .ComptimeInt) {
18216 return sema.failWithNeededComptime(block, operand_src, "value being casted to 'comptime_int' must be comptime known");
18216 return sema.failWithNeededComptime(block, operand_src, "value being casted to 'comptime_int' must be comptime-known");
1821718217 }
1821818218
1821918219 try sema.requireRuntimeBlock(block, inst_data.src(), operand_src);
......@@ -18246,7 +18246,7 @@ fn zirIntToFloat(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!
1824618246 const result_val = try val.intToFloatAdvanced(sema.arena, operand_ty, dest_ty, target, sema.kit(block, operand_src));
1824718247 return sema.addConstant(dest_ty, result_val);
1824818248 } else if (dest_ty.zigTypeTag() == .ComptimeFloat) {
18249 return sema.failWithNeededComptime(block, operand_src, "value being casted to 'comptime_float' must be comptime known");
18249 return sema.failWithNeededComptime(block, operand_src, "value being casted to 'comptime_float' must be comptime-known");
1825018250 }
1825118251
1825218252 try sema.requireRuntimeBlock(block, inst_data.src(), operand_src);
......@@ -18826,7 +18826,7 @@ fn bitOffsetOf(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!u6
1882618826 const extra = sema.code.extraData(Zir.Inst.Bin, inst_data.payload_index).data;
1882718827
1882818828 const ty = try sema.resolveType(block, lhs_src, extra.lhs);
18829 const field_name = try sema.resolveConstString(block, rhs_src, extra.rhs, "name of field must be comptime known");
18829 const field_name = try sema.resolveConstString(block, rhs_src, extra.rhs, "name of field must be comptime-known");
1883018830 const target = sema.mod.getTarget();
1883118831
1883218832 try sema.resolveTypeLayout(block, lhs_src, ty);
......@@ -19301,19 +19301,19 @@ fn resolveExportOptions(
1930119301 const visibility_src = sema.maybeOptionsSrc(block, src, "visibility");
1930219302
1930319303 const name_operand = try sema.fieldVal(block, src, options, "name", name_src);
19304 const name_val = try sema.resolveConstValue(block, name_src, name_operand, "name of exported value must be comptime known");
19304 const name_val = try sema.resolveConstValue(block, name_src, name_operand, "name of exported value must be comptime-known");
1930519305 const name_ty = Type.initTag(.const_slice_u8);
1930619306 const name = try name_val.toAllocatedBytes(name_ty, sema.arena, sema.mod);
1930719307
1930819308 const linkage_operand = try sema.fieldVal(block, src, options, "linkage", linkage_src);
19309 const linkage_val = try sema.resolveConstValue(block, linkage_src, linkage_operand, "linkage of exported value must be comptime known");
19309 const linkage_val = try sema.resolveConstValue(block, linkage_src, linkage_operand, "linkage of exported value must be comptime-known");
1931019310 const linkage = linkage_val.toEnum(std.builtin.GlobalLinkage);
1931119311
1931219312 const section = try sema.fieldVal(block, src, options, "section", section_src);
19313 const section_val = try sema.resolveConstValue(block, section_src, section, "linksection of exported value must be comptime known");
19313 const section_val = try sema.resolveConstValue(block, section_src, section, "linksection of exported value must be comptime-known");
1931419314
1931519315 const visibility_operand = try sema.fieldVal(block, src, options, "visibility", visibility_src);
19316 const visibility_val = try sema.resolveConstValue(block, visibility_src, visibility_operand, "visibility of exported value must be comptime known");
19316 const visibility_val = try sema.resolveConstValue(block, visibility_src, visibility_operand, "visibility of exported value must be comptime-known");
1931719317 const visibility = visibility_val.toEnum(std.builtin.SymbolVisibility);
1931819318
1931919319 if (name.len < 1) {
......@@ -19369,7 +19369,7 @@ fn resolveAtomicRmwOp(
1936919369 src: LazySrcLoc,
1937019370 zir_ref: Zir.Inst.Ref,
1937119371) CompileError!std.builtin.AtomicRmwOp {
19372 return resolveBuiltinEnum(sema, block, src, zir_ref, "AtomicRmwOp", "@atomicRmW operation must be comptime known");
19372 return resolveBuiltinEnum(sema, block, src, zir_ref, "AtomicRmwOp", "@atomicRmW operation must be comptime-known");
1937319373}
1937419374
1937519375fn zirCmpxchg(
......@@ -19405,8 +19405,8 @@ fn zirCmpxchg(
1940519405 const uncasted_ptr = try sema.resolveInst(extra.ptr);
1940619406 const ptr = try sema.checkAtomicPtrOperand(block, elem_ty, elem_ty_src, uncasted_ptr, ptr_src, false);
1940719407 const new_value = try sema.coerce(block, elem_ty, try sema.resolveInst(extra.new_value), new_value_src);
19408 const success_order = try sema.resolveAtomicOrder(block, success_order_src, extra.success_order, "atomic order of cmpxchg success must be comptime known");
19409 const failure_order = try sema.resolveAtomicOrder(block, failure_order_src, extra.failure_order, "atomic order of cmpxchg failure must be comptime known");
19408 const success_order = try sema.resolveAtomicOrder(block, success_order_src, extra.success_order, "atomic order of cmpxchg success must be comptime-known");
19409 const failure_order = try sema.resolveAtomicOrder(block, failure_order_src, extra.failure_order, "atomic order of cmpxchg failure must be comptime-known");
1941019410
1941119411 if (@enumToInt(success_order) < @enumToInt(std.builtin.AtomicOrder.Monotonic)) {
1941219412 return sema.fail(block, success_order_src, "success atomic ordering must be Monotonic or stricter", .{});
......@@ -19471,7 +19471,7 @@ fn zirSplat(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air.I
1947119471 const extra = sema.code.extraData(Zir.Inst.Bin, inst_data.payload_index).data;
1947219472 const len_src: LazySrcLoc = .{ .node_offset_bin_lhs = inst_data.src_node };
1947319473 const scalar_src: LazySrcLoc = .{ .node_offset_bin_rhs = inst_data.src_node };
19474 const len = @intCast(u32, try sema.resolveInt(block, len_src, extra.lhs, Type.u32, "vector splat destination length must be comptime known"));
19474 const len = @intCast(u32, try sema.resolveInt(block, len_src, extra.lhs, Type.u32, "vector splat destination length must be comptime-known"));
1947519475 const scalar = try sema.resolveInst(extra.rhs);
1947619476 const scalar_ty = sema.typeOf(scalar);
1947719477 try sema.checkVectorElemType(block, scalar_src, scalar_ty);
......@@ -19497,7 +19497,7 @@ fn zirReduce(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air.
1949719497 const extra = sema.code.extraData(Zir.Inst.Bin, inst_data.payload_index).data;
1949819498 const op_src: LazySrcLoc = .{ .node_offset_builtin_call_arg0 = inst_data.src_node };
1949919499 const operand_src: LazySrcLoc = .{ .node_offset_builtin_call_arg1 = inst_data.src_node };
19500 const operation = try sema.resolveBuiltinEnum(block, op_src, extra.lhs, "ReduceOp", "@reduce operation must be comptime known");
19500 const operation = try sema.resolveBuiltinEnum(block, op_src, extra.lhs, "ReduceOp", "@reduce operation must be comptime-known");
1950119501 const operand = try sema.resolveInst(extra.rhs);
1950219502 const operand_ty = sema.typeOf(operand);
1950319503 const target = sema.mod.getTarget();
......@@ -19584,7 +19584,7 @@ fn zirShuffle(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air
1958419584 .elem_type = Type.@"i32",
1958519585 });
1958619586 mask = try sema.coerce(block, mask_ty, mask, mask_src);
19587 const mask_val = try sema.resolveConstMaybeUndefVal(block, mask_src, mask, "shuffle mask must be comptime known");
19587 const mask_val = try sema.resolveConstMaybeUndefVal(block, mask_src, mask, "shuffle mask must be comptime-known");
1958819588 return sema.analyzeShuffle(block, inst_data.src_node, elem_ty, a, b, mask_val, @intCast(u32, mask_len));
1958919589}
1959019590
......@@ -19852,7 +19852,7 @@ fn zirAtomicLoad(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!
1985219852 const elem_ty = try sema.resolveType(block, elem_ty_src, extra.elem_type);
1985319853 const uncasted_ptr = try sema.resolveInst(extra.ptr);
1985419854 const ptr = try sema.checkAtomicPtrOperand(block, elem_ty, elem_ty_src, uncasted_ptr, ptr_src, true);
19855 const order = try sema.resolveAtomicOrder(block, order_src, extra.ordering, "atomic order of @atomicLoad must be comptime known");
19855 const order = try sema.resolveAtomicOrder(block, order_src, extra.ordering, "atomic order of @atomicLoad must be comptime-known");
1985619856
1985719857 switch (order) {
1985819858 .Release, .AcqRel => {
......@@ -19916,7 +19916,7 @@ fn zirAtomicRmw(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!A
1991619916 },
1991719917 else => {},
1991819918 }
19919 const order = try sema.resolveAtomicOrder(block, order_src, extra.ordering, "atomic order of @atomicRmW must be comptime known");
19919 const order = try sema.resolveAtomicOrder(block, order_src, extra.ordering, "atomic order of @atomicRmW must be comptime-known");
1992019920
1992119921 if (order == .Unordered) {
1992219922 return sema.fail(block, order_src, "@atomicRmw atomic ordering must not be Unordered", .{});
......@@ -19984,7 +19984,7 @@ fn zirAtomicStore(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError
1998419984 const elem_ty = sema.typeOf(operand);
1998519985 const uncasted_ptr = try sema.resolveInst(extra.ptr);
1998619986 const ptr = try sema.checkAtomicPtrOperand(block, elem_ty, elem_ty_src, uncasted_ptr, ptr_src, false);
19987 const order = try sema.resolveAtomicOrder(block, order_src, extra.ordering, "atomic order of @atomicStore must be comptime known");
19987 const order = try sema.resolveAtomicOrder(block, order_src, extra.ordering, "atomic order of @atomicStore must be comptime-known");
1998819988
1998919989 const air_tag: Air.Inst.Tag = switch (order) {
1999019990 .Acquire, .AcqRel => {
......@@ -20087,11 +20087,11 @@ fn resolveCallOptions(
2008720087 const stack_src = sema.maybeOptionsSrc(block, src, "stack");
2008820088
2008920089 const modifier = try sema.fieldVal(block, src, options, "modifier", modifier_src);
20090 const modifier_val = try sema.resolveConstValue(block, modifier_src, modifier, "call modifier must be comptime known");
20090 const modifier_val = try sema.resolveConstValue(block, modifier_src, modifier, "call modifier must be comptime-known");
2009120091 const wanted_modifier = modifier_val.toEnum(std.builtin.CallOptions.Modifier);
2009220092
2009320093 const stack = try sema.fieldVal(block, src, options, "stack", stack_src);
20094 const stack_val = try sema.resolveConstValue(block, stack_src, stack, "call stack value must be comptime known");
20094 const stack_val = try sema.resolveConstValue(block, stack_src, stack, "call stack value must be comptime-known");
2009520095
2009620096 if (!stack_val.isNull()) {
2009720097 return sema.fail(block, stack_src, "TODO: implement @call with stack", .{});
......@@ -20221,7 +20221,7 @@ fn zirFieldParentPtr(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileEr
2022120221 const ptr_src: LazySrcLoc = .{ .node_offset_builtin_call_arg2 = inst_data.src_node };
2022220222
2022320223 const struct_ty = try sema.resolveType(block, ty_src, extra.parent_type);
20224 const field_name = try sema.resolveConstString(block, name_src, extra.field_name, "field name must be comptime known");
20224 const field_name = try sema.resolveConstString(block, name_src, extra.field_name, "field name must be comptime-known");
2022520225 const field_ptr = try sema.resolveInst(extra.field_ptr);
2022620226 const field_ptr_ty = sema.typeOf(field_ptr);
2022720227
......@@ -20538,7 +20538,7 @@ fn zirVarExtended(
2053820538 uncasted_init;
2053920539
2054020540 break :blk (try sema.resolveMaybeUndefVal(block, init_src, init)) orelse
20541 return sema.failWithNeededComptime(block, init_src, "container level variable initializers must be comptime known");
20541 return sema.failWithNeededComptime(block, init_src, "container level variable initializers must be comptime-known");
2054220542 } else Value.initTag(.unreachable_value);
2054320543
2054420544 try sema.validateVarType(block, ty_src, var_ty, small.is_extern);
......@@ -20607,7 +20607,7 @@ fn zirFuncFancy(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!A
2060720607 const body = sema.code.extra[extra_index..][0..body_len];
2060820608 extra_index += body.len;
2060920609
20610 const val = try sema.resolveGenericBody(block, align_src, body, inst, Type.u29, "alignment must be comptime known");
20610 const val = try sema.resolveGenericBody(block, align_src, body, inst, Type.u29, "alignment must be comptime-known");
2061120611 if (val.tag() == .generic_poison) {
2061220612 break :blk null;
2061320613 }
......@@ -20621,7 +20621,7 @@ fn zirFuncFancy(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!A
2062120621 } else if (extra.data.bits.has_align_ref) blk: {
2062220622 const align_ref = @intToEnum(Zir.Inst.Ref, sema.code.extra[extra_index]);
2062320623 extra_index += 1;
20624 const align_tv = sema.resolveInstConst(block, align_src, align_ref, "alignment must be comptime known") catch |err| switch (err) {
20624 const align_tv = sema.resolveInstConst(block, align_src, align_ref, "alignment must be comptime-known") catch |err| switch (err) {
2062520625 error.GenericPoison => {
2062620626 break :blk null;
2062720627 },
......@@ -20643,7 +20643,7 @@ fn zirFuncFancy(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!A
2064320643 extra_index += body.len;
2064420644
2064520645 const addrspace_ty = try sema.getBuiltinType(block, addrspace_src, "AddressSpace");
20646 const val = try sema.resolveGenericBody(block, addrspace_src, body, inst, addrspace_ty, "addrespace must be comptime known");
20646 const val = try sema.resolveGenericBody(block, addrspace_src, body, inst, addrspace_ty, "addrespace must be comptime-known");
2064720647 if (val.tag() == .generic_poison) {
2064820648 break :blk null;
2064920649 }
......@@ -20651,7 +20651,7 @@ fn zirFuncFancy(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!A
2065120651 } else if (extra.data.bits.has_addrspace_ref) blk: {
2065220652 const addrspace_ref = @intToEnum(Zir.Inst.Ref, sema.code.extra[extra_index]);
2065320653 extra_index += 1;
20654 const addrspace_tv = sema.resolveInstConst(block, addrspace_src, addrspace_ref, "addrespace must be comptime known") catch |err| switch (err) {
20654 const addrspace_tv = sema.resolveInstConst(block, addrspace_src, addrspace_ref, "addrespace must be comptime-known") catch |err| switch (err) {
2065520655 error.GenericPoison => {
2065620656 break :blk null;
2065720657 },
......@@ -20666,7 +20666,7 @@ fn zirFuncFancy(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!A
2066620666 const body = sema.code.extra[extra_index..][0..body_len];
2066720667 extra_index += body.len;
2066820668
20669 const val = try sema.resolveGenericBody(block, section_src, body, inst, Type.initTag(.const_slice_u8), "linksection must be comptime known");
20669 const val = try sema.resolveGenericBody(block, section_src, body, inst, Type.initTag(.const_slice_u8), "linksection must be comptime-known");
2067020670 if (val.tag() == .generic_poison) {
2067120671 break :blk FuncLinkSection{ .generic = {} };
2067220672 }
......@@ -20674,7 +20674,7 @@ fn zirFuncFancy(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!A
2067420674 } else if (extra.data.bits.has_section_ref) blk: {
2067520675 const section_ref = @intToEnum(Zir.Inst.Ref, sema.code.extra[extra_index]);
2067620676 extra_index += 1;
20677 const section_tv = sema.resolveInstConst(block, section_src, section_ref, "linksection must be comptime known") catch |err| switch (err) {
20677 const section_tv = sema.resolveInstConst(block, section_src, section_ref, "linksection must be comptime-known") catch |err| switch (err) {
2067820678 error.GenericPoison => {
2067920679 break :blk FuncLinkSection{ .generic = {} };
2068020680 },
......@@ -20691,7 +20691,7 @@ fn zirFuncFancy(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!A
2069120691 extra_index += body.len;
2069220692
2069320693 const cc_ty = try sema.getBuiltinType(block, addrspace_src, "CallingConvention");
20694 const val = try sema.resolveGenericBody(block, cc_src, body, inst, cc_ty, "calling convention must be comptime known");
20694 const val = try sema.resolveGenericBody(block, cc_src, body, inst, cc_ty, "calling convention must be comptime-known");
2069520695 if (val.tag() == .generic_poison) {
2069620696 break :blk null;
2069720697 }
......@@ -20699,7 +20699,7 @@ fn zirFuncFancy(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!A
2069920699 } else if (extra.data.bits.has_cc_ref) blk: {
2070020700 const cc_ref = @intToEnum(Zir.Inst.Ref, sema.code.extra[extra_index]);
2070120701 extra_index += 1;
20702 const cc_tv = sema.resolveInstConst(block, cc_src, cc_ref, "calling convention must be comptime known") catch |err| switch (err) {
20702 const cc_tv = sema.resolveInstConst(block, cc_src, cc_ref, "calling convention must be comptime-known") catch |err| switch (err) {
2070320703 error.GenericPoison => {
2070420704 break :blk null;
2070520705 },
......@@ -20714,14 +20714,14 @@ fn zirFuncFancy(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!A
2071420714 const body = sema.code.extra[extra_index..][0..body_len];
2071520715 extra_index += body.len;
2071620716
20717 const val = try sema.resolveGenericBody(block, ret_src, body, inst, Type.type, "return type must be comptime known");
20717 const val = try sema.resolveGenericBody(block, ret_src, body, inst, Type.type, "return type must be comptime-known");
2071820718 var buffer: Value.ToTypeBuffer = undefined;
2071920719 const ty = try val.toType(&buffer).copy(sema.arena);
2072020720 break :blk ty;
2072120721 } else if (extra.data.bits.has_ret_ty_ref) blk: {
2072220722 const ret_ty_ref = @intToEnum(Zir.Inst.Ref, sema.code.extra[extra_index]);
2072320723 extra_index += 1;
20724 const ret_ty_tv = sema.resolveInstConst(block, ret_src, ret_ty_ref, "return type must be comptime known") catch |err| switch (err) {
20724 const ret_ty_tv = sema.resolveInstConst(block, ret_src, ret_ty_ref, "return type must be comptime-known") catch |err| switch (err) {
2072520725 error.GenericPoison => {
2072620726 break :blk Type.initTag(.generic_poison);
2072720727 },
......@@ -20777,7 +20777,7 @@ fn zirCUndef(
2077720777 const extra = sema.code.extraData(Zir.Inst.UnNode, extended.operand).data;
2077820778 const src: LazySrcLoc = .{ .node_offset_builtin_call_arg0 = extra.node };
2077920779
20780 const name = try sema.resolveConstString(block, src, extra.operand, "name of macro being undefined must be comptime known");
20780 const name = try sema.resolveConstString(block, src, extra.operand, "name of macro being undefined must be comptime-known");
2078120781 try block.c_import_buf.?.writer().print("#undefine {s}\n", .{name});
2078220782 return Air.Inst.Ref.void_value;
2078320783}
......@@ -20790,7 +20790,7 @@ fn zirCInclude(
2079020790 const extra = sema.code.extraData(Zir.Inst.UnNode, extended.operand).data;
2079120791 const src: LazySrcLoc = .{ .node_offset_builtin_call_arg0 = extra.node };
2079220792
20793 const name = try sema.resolveConstString(block, src, extra.operand, "path being included must be comptime known");
20793 const name = try sema.resolveConstString(block, src, extra.operand, "path being included must be comptime-known");
2079420794 try block.c_import_buf.?.writer().print("#include <{s}>\n", .{name});
2079520795 return Air.Inst.Ref.void_value;
2079620796}
......@@ -20804,10 +20804,10 @@ fn zirCDefine(
2080420804 const name_src: LazySrcLoc = .{ .node_offset_builtin_call_arg0 = extra.node };
2080520805 const val_src: LazySrcLoc = .{ .node_offset_builtin_call_arg1 = extra.node };
2080620806
20807 const name = try sema.resolveConstString(block, name_src, extra.lhs, "name of macro being undefined must be comptime known");
20807 const name = try sema.resolveConstString(block, name_src, extra.lhs, "name of macro being undefined must be comptime-known");
2080820808 const rhs = try sema.resolveInst(extra.rhs);
2080920809 if (sema.typeOf(rhs).zigTypeTag() != .Void) {
20810 const value = try sema.resolveConstString(block, val_src, extra.rhs, "value of macro being undefined must be comptime known");
20810 const value = try sema.resolveConstString(block, val_src, extra.rhs, "value of macro being undefined must be comptime-known");
2081120811 try block.c_import_buf.?.writer().print("#define {s} {s}\n", .{ name, value });
2081220812 } else {
2081320813 try block.c_import_buf.?.writer().print("#define {s}\n", .{name});
......@@ -20828,7 +20828,7 @@ fn zirWasmMemorySize(
2082820828 return sema.fail(block, builtin_src, "builtin @wasmMemorySize is available when targeting WebAssembly; targeted CPU architecture is {s}", .{@tagName(target.cpu.arch)});
2082920829 }
2083020830
20831 const index = @intCast(u32, try sema.resolveInt(block, index_src, extra.operand, Type.u32, "wasm memory size index must be comptime known"));
20831 const index = @intCast(u32, try sema.resolveInt(block, index_src, extra.operand, Type.u32, "wasm memory size index must be comptime-known"));
2083220832 try sema.requireRuntimeBlock(block, builtin_src, null);
2083320833 return block.addInst(.{
2083420834 .tag = .wasm_memory_size,
......@@ -20853,7 +20853,7 @@ fn zirWasmMemoryGrow(
2085320853 return sema.fail(block, builtin_src, "builtin @wasmMemoryGrow is available when targeting WebAssembly; targeted CPU architecture is {s}", .{@tagName(target.cpu.arch)});
2085420854 }
2085520855
20856 const index = @intCast(u32, try sema.resolveInt(block, index_src, extra.lhs, Type.u32, "wasm memory size index must be comptime known"));
20856 const index = @intCast(u32, try sema.resolveInt(block, index_src, extra.lhs, Type.u32, "wasm memory size index must be comptime-known"));
2085720857 const delta = try sema.coerce(block, Type.u32, try sema.resolveInst(extra.rhs), delta_src);
2085820858
2085920859 try sema.requireRuntimeBlock(block, builtin_src, null);
......@@ -20881,13 +20881,13 @@ fn resolvePrefetchOptions(
2088120881 const cache_src = sema.maybeOptionsSrc(block, src, "cache");
2088220882
2088320883 const rw = try sema.fieldVal(block, src, options, "rw", rw_src);
20884 const rw_val = try sema.resolveConstValue(block, rw_src, rw, "prefetch read/write must be comptime known");
20884 const rw_val = try sema.resolveConstValue(block, rw_src, rw, "prefetch read/write must be comptime-known");
2088520885
2088620886 const locality = try sema.fieldVal(block, src, options, "locality", locality_src);
20887 const locality_val = try sema.resolveConstValue(block, locality_src, locality, "prefetch locality must be comptime known");
20887 const locality_val = try sema.resolveConstValue(block, locality_src, locality, "prefetch locality must be comptime-known");
2088820888
2088920889 const cache = try sema.fieldVal(block, src, options, "cache", cache_src);
20890 const cache_val = try sema.resolveConstValue(block, cache_src, cache, "prefetch cache must be comptime known");
20890 const cache_val = try sema.resolveConstValue(block, cache_src, cache, "prefetch cache must be comptime-known");
2089120891
2089220892 return std.builtin.PrefetchOptions{
2089320893 .rw = rw_val.toEnum(std.builtin.PrefetchOptions.Rw),
......@@ -20947,18 +20947,18 @@ fn resolveExternOptions(
2094720947 const thread_local_src = sema.maybeOptionsSrc(block, src, "thread_local");
2094820948
2094920949 const name_ref = try sema.fieldVal(block, src, options, "name", name_src);
20950 const name_val = try sema.resolveConstValue(block, name_src, name_ref, "name of the extern symbol must be comptime known");
20950 const name_val = try sema.resolveConstValue(block, name_src, name_ref, "name of the extern symbol must be comptime-known");
2095120951 const name = try name_val.toAllocatedBytes(Type.initTag(.const_slice_u8), sema.arena, mod);
2095220952
2095320953 const library_name_inst = try sema.fieldVal(block, src, options, "library_name", library_src);
20954 const library_name_val = try sema.resolveConstValue(block, library_src, library_name_inst, "library in which extern symbol is must be comptime known");
20954 const library_name_val = try sema.resolveConstValue(block, library_src, library_name_inst, "library in which extern symbol is must be comptime-known");
2095520955
2095620956 const linkage_ref = try sema.fieldVal(block, src, options, "linkage", linkage_src);
20957 const linkage_val = try sema.resolveConstValue(block, linkage_src, linkage_ref, "linkage of the extern symbol must be comptime known");
20957 const linkage_val = try sema.resolveConstValue(block, linkage_src, linkage_ref, "linkage of the extern symbol must be comptime-known");
2095820958 const linkage = linkage_val.toEnum(std.builtin.GlobalLinkage);
2095920959
2096020960 const is_thread_local = try sema.fieldVal(block, src, options, "is_thread_local", thread_local_src);
20961 const is_thread_local_val = try sema.resolveConstValue(block, thread_local_src, is_thread_local, "threadlocality of the extern symbol must be comptime known");
20961 const is_thread_local_val = try sema.resolveConstValue(block, thread_local_src, is_thread_local, "threadlocality of the extern symbol must be comptime-known");
2096220962
2096320963 const library_name = if (!library_name_val.isNull()) blk: {
2096420964 const payload = library_name_val.castTag(.opt_payload).?.data;
......@@ -22953,7 +22953,7 @@ fn elemPtr(
2295322953 .Array, .Vector => return sema.elemPtrArray(block, src, indexable_ptr_src, indexable_ptr, elem_index_src, elem_index, init),
2295422954 .Struct => {
2295522955 // Tuple field access.
22956 const index_val = try sema.resolveConstValue(block, elem_index_src, elem_index, "tuple field access index must be comptime known");
22956 const index_val = try sema.resolveConstValue(block, elem_index_src, elem_index, "tuple field access index must be comptime-known");
2295722957 const index = @intCast(u32, index_val.toUnsignedInt(target));
2295822958 return sema.tupleFieldPtr(block, src, indexable_ptr, elem_index_src, index, init);
2295922959 },
......@@ -23015,7 +23015,7 @@ fn elemVal(
2301523015 },
2301623016 .Struct => {
2301723017 // Tuple field access.
23018 const index_val = try sema.resolveConstValue(block, elem_index_src, elem_index, "tuple field access index must be comptime known");
23018 const index_val = try sema.resolveConstValue(block, elem_index_src, elem_index, "tuple field access index must be comptime-known");
2301923019 const index = @intCast(u32, index_val.toUnsignedInt(target));
2302023020 return tupleField(sema, block, indexable_src, indexable, elem_index_src, index);
2302123021 },
......@@ -23037,7 +23037,7 @@ fn validateRuntimeElemAccess(
2303723037 const msg = try sema.errMsg(
2303823038 block,
2303923039 elem_index_src,
23040 "values of type '{}' must be comptime known, but index value is runtime known",
23040 "values of type '{}' must be comptime-known, but index value is runtime-known",
2304123041 .{parent_ty.fmt(sema.mod)},
2304223042 );
2304323043 errdefer msg.destroy(sema.gpa);
......@@ -23742,7 +23742,7 @@ fn coerceExtra(
2374223742 const val = (try sema.resolveDefinedValue(block, inst_src, inst)) orelse {
2374323743 if (dest_ty.zigTypeTag() == .ComptimeInt) {
2374423744 if (!opts.report_err) return error.NotCoercible;
23745 return sema.failWithNeededComptime(block, inst_src, "value being casted to 'comptime_int' must be comptime known");
23745 return sema.failWithNeededComptime(block, inst_src, "value being casted to 'comptime_int' must be comptime-known");
2374623746 }
2374723747 break :float;
2374823748 };
......@@ -23760,7 +23760,7 @@ fn coerceExtra(
2376023760 },
2376123761 .Int, .ComptimeInt => {
2376223762 if (try sema.resolveDefinedValue(block, inst_src, inst)) |val| {
23763 // comptime known integer to other number
23763 // comptime-known integer to other number
2376423764 if (!(try sema.intFitsInType(block, inst_src, val, dest_ty, null))) {
2376523765 if (!opts.report_err) return error.NotCoercible;
2376623766 return sema.fail(block, inst_src, "type '{}' cannot represent integer value '{}'", .{ dest_ty.fmt(sema.mod), val.fmtValue(inst_ty, sema.mod) });
......@@ -23770,7 +23770,7 @@ fn coerceExtra(
2377023770 if (dest_ty.zigTypeTag() == .ComptimeInt) {
2377123771 if (!opts.report_err) return error.NotCoercible;
2377223772 if (opts.no_cast_to_comptime_int) return inst;
23773 return sema.failWithNeededComptime(block, inst_src, "value being casted to 'comptime_int' must be comptime known");
23773 return sema.failWithNeededComptime(block, inst_src, "value being casted to 'comptime_int' must be comptime-known");
2377423774 }
2377523775
2377623776 // integer widening
......@@ -23809,7 +23809,7 @@ fn coerceExtra(
2380923809 return try sema.addConstant(dest_ty, result_val);
2381023810 } else if (dest_ty.zigTypeTag() == .ComptimeFloat) {
2381123811 if (!opts.report_err) return error.NotCoercible;
23812 return sema.failWithNeededComptime(block, inst_src, "value being casted to 'comptime_float' must be comptime known");
23812 return sema.failWithNeededComptime(block, inst_src, "value being casted to 'comptime_float' must be comptime-known");
2381323813 }
2381423814
2381523815 // float widening
......@@ -23824,7 +23824,7 @@ fn coerceExtra(
2382423824 const val = (try sema.resolveDefinedValue(block, inst_src, inst)) orelse {
2382523825 if (dest_ty.zigTypeTag() == .ComptimeFloat) {
2382623826 if (!opts.report_err) return error.NotCoercible;
23827 return sema.failWithNeededComptime(block, inst_src, "value being casted to 'comptime_float' must be comptime known");
23827 return sema.failWithNeededComptime(block, inst_src, "value being casted to 'comptime_float' must be comptime-known");
2382823828 }
2382923829 break :int;
2383023830 };
......@@ -26620,7 +26620,7 @@ fn coerceTupleToStruct(
2662026620 field_refs[field_index] = coerced;
2662126621 if (field.is_comptime) {
2662226622 const init_val = (try sema.resolveMaybeUndefVal(block, field_src, coerced)) orelse {
26623 return sema.failWithNeededComptime(block, field_src, "value stored in comptime field must be comptime known");
26623 return sema.failWithNeededComptime(block, field_src, "value stored in comptime field must be comptime-known");
2662426624 };
2662526625
2662626626 if (!init_val.eql(field.default_val, field.ty, sema.mod)) {
......@@ -26716,7 +26716,7 @@ fn coerceTupleToTuple(
2671626716 field_refs[field_index] = coerced;
2671726717 if (default_val.tag() != .unreachable_value) {
2671826718 const init_val = (try sema.resolveMaybeUndefVal(block, field_src, coerced)) orelse {
26719 return sema.failWithNeededComptime(block, field_src, "value stored in comptime field must be comptime known");
26719 return sema.failWithNeededComptime(block, field_src, "value stored in comptime field must be comptime-known");
2672026720 };
2672126721
2672226722 if (!init_val.eql(default_val, field_ty, sema.mod)) {
......@@ -27086,7 +27086,7 @@ fn analyzeIsNonErrComptimeOnly(
2708627086 const maybe_operand_val = try sema.resolveMaybeUndefVal(block, src, operand);
2708727087
2708827088 // exception if the error union error set is known to be empty,
27089 // we allow the comparison but always make it comptime known.
27089 // we allow the comparison but always make it comptime-known.
2709027090 const set_ty = operand_ty.errorUnionSet();
2709127091 switch (set_ty.tag()) {
2709227092 .anyerror => {},
......@@ -27353,7 +27353,7 @@ fn analyzeSlice(
2735327353 const sentinel = s: {
2735427354 if (sentinel_opt != .none) {
2735527355 const casted = try sema.coerce(block, elem_ty, sentinel_opt, sentinel_src);
27356 break :s try sema.resolveConstValue(block, sentinel_src, casted, "slice sentinel must be comptime known");
27356 break :s try sema.resolveConstValue(block, sentinel_src, casted, "slice sentinel must be comptime-known");
2735727357 }
2735827358 // If we are slicing to the end of something that is sentinel-terminated
2735927359 // then the resulting slice type is also sentinel-terminated.
......@@ -27616,7 +27616,7 @@ fn cmpNumeric(
2761627616 };
2761727617
2761827618 // TODO handle comparisons against lazy zero values
27619 // Some values can be compared against zero without being runtime known or without forcing
27619 // Some values can be compared against zero without being runtime-known or without forcing
2762027620 // a full resolution of their value, for example `@sizeOf(@Frame(function))` is known to
2762127621 // always be nonzero, and we benefit from not forcing the full evaluation and stack frame layout
2762227622 // of this function if we don't need to.
......@@ -29275,7 +29275,7 @@ fn semaStructFields(mod: *Module, struct_obj: *Module.Struct) CompileError!void
2927529275 const field = &struct_obj.fields.values()[i];
2927629276 const coerced = try sema.coerce(&block_scope, field.ty, init, src);
2927729277 const default_val = (try sema.resolveMaybeUndefVal(&block_scope, src, coerced)) orelse
29278 return sema.failWithNeededComptime(&block_scope, src, "struct field default value must be comptime known");
29278 return sema.failWithNeededComptime(&block_scope, src, "struct field default value must be comptime-known");
2927929279 field.default_val = try default_val.copy(decl_arena_allocator);
2928029280 }
2928129281 }
......@@ -29471,7 +29471,7 @@ fn semaUnionFields(mod: *Module, union_obj: *Module.Union) CompileError!void {
2947129471 if (tag_ref != .none) {
2947229472 const tag_src = src; // TODO better source location
2947329473 const coerced = try sema.coerce(&block_scope, int_tag_ty, tag_ref, tag_src);
29474 const val = try sema.resolveConstValue(&block_scope, tag_src, coerced, "enum tag value must be comptime known");
29474 const val = try sema.resolveConstValue(&block_scope, tag_src, coerced, "enum tag value must be comptime-known");
2947529475 last_tag_val = val;
2947629476
2947729477 // This puts the memory into the union arena, not the enum arena, but
......@@ -30295,7 +30295,7 @@ pub fn analyzeAddrspace(
3029530295 zir_ref: Zir.Inst.Ref,
3029630296 ctx: AddressSpaceContext,
3029730297) !std.builtin.AddressSpace {
30298 const addrspace_tv = try sema.resolveInstConst(block, src, zir_ref, "addresspace must be comptime known");
30298 const addrspace_tv = try sema.resolveInstConst(block, src, zir_ref, "addresspace must be comptime-known");
3029930299 const address_space = addrspace_tv.val.toEnum(std.builtin.AddressSpace);
3030030300 const target = sema.mod.getTarget();
3030130301 const arch = target.cpu.arch;
src/arch/aarch64/CodeGen.zig+1-1
......@@ -5425,7 +5425,7 @@ fn parseRegName(name: []const u8) ?Register {
54255425
54265426fn registerAlias(reg: Register, size_bytes: u64) Register {
54275427 if (size_bytes == 0) {
5428 unreachable; // should be comptime known
5428 unreachable; // should be comptime-known
54295429 } else if (size_bytes <= 4) {
54305430 return reg.to32();
54315431 } else if (size_bytes <= 8) {
src/arch/riscv64/CodeGen.zig+1-1
......@@ -1769,7 +1769,7 @@ fn airCall(self: *Self, inst: Air.Inst.Index, modifier: std.builtin.CallOptions.
17691769 return self.fail("TODO implement calling bitcasted functions", .{});
17701770 }
17711771 } else {
1772 return self.fail("TODO implement calling runtime known function pointer", .{});
1772 return self.fail("TODO implement calling runtime-known function pointer", .{});
17731773 }
17741774 } else if (self.bin_file.cast(link.File.Coff)) |_| {
17751775 return self.fail("TODO implement calling in COFF for {}", .{self.target.cpu.arch});
src/arch/x86_64/CodeGen.zig+1-1
......@@ -7272,7 +7272,7 @@ fn parseRegName(name: []const u8) ?Register {
72727272/// Returns register wide enough to hold at least `size_bytes`.
72737273fn registerAlias(reg: Register, size_bytes: u32) Register {
72747274 if (size_bytes == 0) {
7275 unreachable; // should be comptime known
7275 unreachable; // should be comptime-known
72767276 } else if (size_bytes <= 1) {
72777277 return reg.to8();
72787278 } else if (size_bytes <= 2) {
src/link.zig+1-1
......@@ -305,7 +305,7 @@ pub const File = struct {
305305 };
306306 }
307307 const emit = options.emit.?;
308 const use_lld = build_options.have_llvm and options.use_lld; // comptime known false when !have_llvm
308 const use_lld = build_options.have_llvm and options.use_lld; // comptime-known false when !have_llvm
309309 const sub_path = if (use_lld) blk: {
310310 if (options.module == null) {
311311 // No point in opening a file, we would not write anything to it.
src/tracy.zig+2-2
......@@ -173,13 +173,13 @@ pub fn TracyAllocator(comptime name: ?[:0]const u8) type {
173173 };
174174}
175175
176// This function only accepts comptime known strings, see `messageCopy` for runtime strings
176// This function only accepts comptime-known strings, see `messageCopy` for runtime strings
177177pub inline fn message(comptime msg: [:0]const u8) void {
178178 if (!enable) return;
179179 ___tracy_emit_messageL(msg.ptr, if (enable_callstack) callstack_depth else 0);
180180}
181181
182// This function only accepts comptime known strings, see `messageColorCopy` for runtime strings
182// This function only accepts comptime-known strings, see `messageColorCopy` for runtime strings
183183pub inline fn messageColor(comptime msg: [:0]const u8, color: u32) void {
184184 if (!enable) return;
185185 ___tracy_emit_messageLC(msg.ptr, color, if (enable_callstack) callstack_depth else 0);
src/type.zig+1-1
......@@ -2318,7 +2318,7 @@ pub const Type = extern union {
23182318 /// * the type has only one possible value, making its ABI size 0.
23192319 /// - an enum with an explicit tag type has the ABI size of the integer tag type,
23202320 /// making it one-possible-value only if the integer tag type has 0 bits.
2321 /// When `ignore_comptime_only` is true, then types that are comptime only
2321 /// When `ignore_comptime_only` is true, then types that are comptime-only
23222322 /// may return false positives.
23232323 pub fn hasRuntimeBitsAdvanced(
23242324 ty: Type,
test/behavior/align.zig+1-1
......@@ -400,7 +400,7 @@ test "function callconv expression depends on generic parameter" {
400400 comptime try S.doTheTest();
401401}
402402
403test "runtime known array index has best alignment possible" {
403test "runtime-known array index has best alignment possible" {
404404 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
405405
406406 // take full advantage of over-alignment
test/behavior/array.zig+1-1
......@@ -564,7 +564,7 @@ test "type coercion of pointer to anon struct literal to pointer to array" {
564564 comptime try S.doTheTest();
565565}
566566
567test "array with comptime only element type" {
567test "array with comptime-only element type" {
568568 const a = [_]type{ u32, i32 };
569569 try testing.expect(a[0] == u32);
570570 try testing.expect(a[1] == i32);
test/behavior/basic.zig+1-1
......@@ -999,7 +999,7 @@ test "generic function uses return type of other generic function" {
999999 try std.testing.expect(S.call(S.func, .{@as(u8, 1)}) == 1);
10001000}
10011001
1002test "const alloc with comptime known initializer is made comptime known" {
1002test "const alloc with comptime-known initializer is made comptime-known" {
10031003 const S = struct {
10041004 a: bool,
10051005 b: [2]u8,
test/behavior/enum.zig+2-2
......@@ -846,12 +846,12 @@ fn doALoopThing(id: EnumWithOneMember) void {
846846 }
847847}
848848
849test "comparison operator on enum with one member is comptime known" {
849test "comparison operator on enum with one member is comptime-known" {
850850 doALoopThing(EnumWithOneMember.Eof);
851851}
852852
853853const State = enum { Start };
854test "switch on enum with one member is comptime known" {
854test "switch on enum with one member is comptime-known" {
855855 var state = State.Start;
856856 switch (state) {
857857 State.Start => return,
test/behavior/eval.zig+5-5
......@@ -582,16 +582,16 @@ test "comparisons 0 <= uint and 0 > uint should be comptime" {
582582}
583583fn testCompTimeUIntComparisons(x: u32) void {
584584 if (!(0 <= x)) {
585 @compileError("this condition should be comptime known");
585 @compileError("this condition should be comptime-known");
586586 }
587587 if (0 > x) {
588 @compileError("this condition should be comptime known");
588 @compileError("this condition should be comptime-known");
589589 }
590590 if (!(x >= 0)) {
591 @compileError("this condition should be comptime known");
591 @compileError("this condition should be comptime-known");
592592 }
593593 if (x < 0) {
594 @compileError("this condition should be comptime known");
594 @compileError("this condition should be comptime-known");
595595 }
596596}
597597
......@@ -1302,7 +1302,7 @@ test "repeated value is correctly expanded" {
13021302 }
13031303}
13041304
1305test "value in if block is comptime known" {
1305test "value in if block is comptime-known" {
13061306 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
13071307
13081308 const first = blk: {
test/behavior/math.zig+1-1
......@@ -990,7 +990,7 @@ test "overflow arithmetic with u0 values" {
990990 try expect(result == 0);
991991}
992992
993test "allow signed integer division/remainder when values are comptime known and positive or exact" {
993test "allow signed integer division/remainder when values are comptime-known and positive or exact" {
994994 if (builtin.zig_backend == .stage1) return error.SkipZigTest;
995995
996996 try expect(5 / 3 == 1);
test/behavior/struct.zig+1-1
......@@ -653,7 +653,7 @@ test "default struct initialization fields" {
653653 .b = five,
654654 };
655655 if (x.a + x.b != 1239) {
656 @compileError("it should be comptime known");
656 @compileError("it should be comptime-known");
657657 }
658658 try expect(y.a == x.a);
659659 try expect(y.b == x.b);
test/behavior/truncate.zig+2-2
......@@ -2,7 +2,7 @@ const std = @import("std");
22const builtin = @import("builtin");
33const expect = std.testing.expect;
44
5test "truncate u0 to larger integer allowed and has comptime known result" {
5test "truncate u0 to larger integer allowed and has comptime-known result" {
66 var x: u0 = 0;
77 const y = @truncate(u8, x);
88 comptime try expect(y == 0);
......@@ -25,7 +25,7 @@ test "truncate.u0.var" {
2525 try expect(z == 0);
2626}
2727
28test "truncate i0 to larger integer allowed and has comptime known result" {
28test "truncate i0 to larger integer allowed and has comptime-known result" {
2929 var x: i0 = 0;
3030 const y = @truncate(i8, x);
3131 comptime try expect(y == 0);
test/cases/compile_errors/dereference_anyopaque.zig+4-4
......@@ -45,11 +45,11 @@ pub export fn entry() void {
4545// backend=llvm
4646//
4747// :11:22: error: comparison of 'void' with null
48// :25:51: error: values of type 'anyopaque' must be comptime known, but operand value is runtime known
48// :25:51: error: values of type 'anyopaque' must be comptime-known, but operand value is runtime-known
4949// :25:51: note: opaque type 'anyopaque' has undefined size
50// :25:51: error: values of type 'fn(*anyopaque, usize, u29, u29, usize) error{OutOfMemory}![]u8' must be comptime known, but operand value is runtime known
50// :25:51: error: values of type 'fn(*anyopaque, usize, u29, u29, usize) error{OutOfMemory}![]u8' must be comptime-known, but operand value is runtime-known
5151// :25:51: note: use '*const fn(*anyopaque, usize, u29, u29, usize) error{OutOfMemory}![]u8' for a function pointer type
52// :25:51: error: values of type 'fn(*anyopaque, []u8, u29, usize, u29, usize) ?usize' must be comptime known, but operand value is runtime known
52// :25:51: error: values of type 'fn(*anyopaque, []u8, u29, usize, u29, usize) ?usize' must be comptime-known, but operand value is runtime-known
5353// :25:51: note: use '*const fn(*anyopaque, []u8, u29, usize, u29, usize) ?usize' for a function pointer type
54// :25:51: error: values of type 'fn(*anyopaque, []u8, u29, usize) void' must be comptime known, but operand value is runtime known
54// :25:51: error: values of type 'fn(*anyopaque, []u8, u29, usize) void' must be comptime-known, but operand value is runtime-known
5555// :25:51: note: use '*const fn(*anyopaque, []u8, u29, usize) void' for a function pointer type
test/cases/compile_errors/error_in_typeof_param.zig+1-1
......@@ -11,4 +11,4 @@ pub export fn entry() void {
1111// target=native
1212//
1313// :6:31: error: unable to resolve comptime value
14// :6:31: note: argument to parameter with comptime only type must be comptime known
14// :6:31: note: argument to parameter with comptime-only type must be comptime-known
test/cases/compile_errors/explain_why_fn_is_called_at_comptime.zig+2-2
......@@ -17,7 +17,7 @@ pub export fn entry() void {
1717// target=native
1818//
1919// :12:13: error: unable to resolve comptime value
20// :12:13: note: argument to function being called at comptime must be comptime known
21// :7:25: note: function is being called at comptime because it returns a comptime only type 'tmp.S'
20// :12:13: note: argument to function being called at comptime must be comptime-known
21// :7:25: note: function is being called at comptime because it returns a comptime-only type 'tmp.S'
2222// :2:12: note: struct requires comptime because of this field
2323// :2:12: note: use '*const fn() void' for a function pointer type
test/cases/compile_errors/explain_why_generic_fn_is_called_at_comptime.zig+2-2
......@@ -18,5 +18,5 @@ pub export fn entry() void {
1818// target=native
1919//
2020// :14:13: error: unable to resolve comptime value
21// :14:13: note: argument to function being called at comptime must be comptime known
22// :9:38: note: generic function is instantiated with a comptime only return type
21// :14:13: note: argument to function being called at comptime must be comptime-known
22// :9:38: note: generic function is instantiated with a comptime-only return type
test/cases/compile_errors/int-float_conversion_to_comptime_int-float.zig+2-2
......@@ -12,6 +12,6 @@ export fn bar() void {
1212// target=native
1313//
1414// :3:35: error: unable to resolve comptime value
15// :3:35: note: value being casted to 'comptime_int' must be comptime known
15// :3:35: note: value being casted to 'comptime_int' must be comptime-known
1616// :7:37: error: unable to resolve comptime value
17// :7:37: note: value being casted to 'comptime_float' must be comptime known
17// :7:37: note: value being casted to 'comptime_float' must be comptime-known
test/cases/compile_errors/non-comptime-parameter-used-as-array-size.zig+1-1
......@@ -12,4 +12,4 @@ fn makeLlamas(count: usize) [count]u8 {
1212// target=native
1313//
1414// :8:30: error: unable to resolve comptime value
15// :8:30: note: array length must be comptime known
15// :8:30: note: array length must be comptime-known
test/cases/compile_errors/non-const_switch_number_literal.zig+1-1
......@@ -14,5 +14,5 @@ fn bar() i32 {
1414// backend=stage2
1515// target=native
1616//
17// :2:15: error: value with comptime only type 'comptime_int' depends on runtime control flow
17// :2:15: error: value with comptime-only type 'comptime_int' depends on runtime control flow
1818// :2:26: note: runtime control flow here
test/cases/compile_errors/non-const_variables_of_things_that_require_const_variables.zig+1-1
......@@ -39,7 +39,7 @@ const Opaque = opaque {};
3939// :14:8: error: variable of type 'comptime_float' must be const or comptime
4040// :14:8: note: to modify this variable at runtime, it must be given an explicit fixed-size number type
4141// :18:8: error: variable of type '@TypeOf(null)' must be const or comptime
42// :22:19: error: values of type 'tmp.Opaque' must be comptime known, but operand value is runtime known
42// :22:19: error: values of type 'tmp.Opaque' must be comptime-known, but operand value is runtime-known
4343// :22:19: note: opaque type 'tmp.Opaque' has undefined size
4444// :26:8: error: variable of type 'type' must be const or comptime
4545// :26:8: note: types are not available at runtime
test/cases/compile_errors/non-inline_for_loop_on_a_type_that_requires_comptime.zig+1-1
......@@ -11,6 +11,6 @@ export fn entry() void {
1111// backend=stage2
1212// target=native
1313//
14// :7:10: error: values of type '[2]tmp.Foo' must be comptime known, but index value is runtime known
14// :7:10: error: values of type '[2]tmp.Foo' must be comptime-known, but index value is runtime-known
1515// :3:8: note: struct requires comptime because of this field
1616// :3:8: note: types are not available at runtime
test/cases/compile_errors/non_comptime_param_in_comptime_function.zig+2-2
......@@ -26,10 +26,10 @@ export fn entry2() void {
2626// backend=stage2
2727// target=native
2828//
29// :1:20: error: function with comptime only return type 'type' requires all parameters to be comptime
29// :1:20: error: function with comptime-only return type 'type' requires all parameters to be comptime
3030// :1:20: note: types are not available at runtime
3131// :1:6: note: param 'val' is required to be comptime
32// :11:16: error: function with comptime only return type 'tmp.S' requires all parameters to be comptime
32// :11:16: error: function with comptime-only return type 'tmp.S' requires all parameters to be comptime
3333// :9:10: note: struct requires comptime because of this field
3434// :9:10: note: use '*const fn() void' for a function pointer type
3535// :11:8: note: param is required to be comptime
test/cases/compile_errors/runtime_index_into_comptime_type_slice.zig+1-1
......@@ -14,6 +14,6 @@ export fn entry() void {
1414// backend=stage2
1515// target=native
1616//
17// :9:51: error: values of type '[]const builtin.Type.StructField' must be comptime known, but index value is runtime known
17// :9:51: error: values of type '[]const builtin.Type.StructField' must be comptime-known, but index value is runtime-known
1818// :?:21: note: struct requires comptime because of this field
1919// :?:21: note: types are not available at runtime
test/cases/compile_errors/runtime_indexing_comptime_array.zig+3-3
......@@ -24,9 +24,9 @@ pub export fn entry3() void {
2424// target=native
2525// backend=stage2
2626//
27// :7:10: error: values of type '[2]fn() void' must be comptime known, but index value is runtime known
27// :7:10: error: values of type '[2]fn() void' must be comptime-known, but index value is runtime-known
2828// :7:10: note: use '*const fn() void' for a function pointer type
29// :15:18: error: values of type '[2]fn() void' must be comptime known, but index value is runtime known
29// :15:18: error: values of type '[2]fn() void' must be comptime-known, but index value is runtime-known
3030// :15:17: note: use '*const fn() void' for a function pointer type
31// :21:19: error: values of type '[2]fn() void' must be comptime known, but index value is runtime known
31// :21:19: error: values of type '[2]fn() void' must be comptime-known, but index value is runtime-known
3232// :21:18: note: use '*const fn() void' for a function pointer type
test/cases/compile_errors/runtime_to_comptime_num.zig+4-4
......@@ -22,10 +22,10 @@ pub export fn entry4() void{
2222// target=native
2323//
2424// :3:27: error: unable to resolve comptime value
25// :3:27: note: value being casted to 'comptime_int' must be comptime known
25// :3:27: note: value being casted to 'comptime_int' must be comptime-known
2626// :7:29: error: unable to resolve comptime value
27// :7:29: note: value being casted to 'comptime_float' must be comptime known
27// :7:29: note: value being casted to 'comptime_float' must be comptime-known
2828// :12:10: error: unable to resolve comptime value
29// :12:10: note: value being casted to 'comptime_float' must be comptime known
29// :12:10: note: value being casted to 'comptime_float' must be comptime-known
3030// :17:10: error: unable to resolve comptime value
31// :17:10: note: value being casted to 'comptime_int' must be comptime known
31// :17:10: note: value being casted to 'comptime_int' must be comptime-known
test/cases/compile_errors/shifting_without_int_type_or_comptime_known.zig+4-4
......@@ -17,7 +17,7 @@ export fn entry3() void {
1717// backend=stage2
1818// target=native
1919//
20// :2:17: error: LHS of shift must be a fixed-width integer type, or RHS must be a comptime known
21// :5:17: error: LHS of shift must be a fixed-width integer type, or RHS must be a comptime known
22// :9:9: error: LHS of shift must be a fixed-width integer type, or RHS must be a comptime known
23// :13:9: error: LHS of shift must be a fixed-width integer type, or RHS must be a comptime known
20// :2:17: error: LHS of shift must be a fixed-width integer type, or RHS must be comptime-known
21// :5:17: error: LHS of shift must be a fixed-width integer type, or RHS must be comptime-known
22// :9:9: error: LHS of shift must be a fixed-width integer type, or RHS must be comptime-known
23// :13:9: error: LHS of shift must be a fixed-width integer type, or RHS must be comptime-known
test/cases/x86_64-linux/assert_function.8.zig+1-1
......@@ -22,4 +22,4 @@ pub fn assert(ok: bool) void {
2222// error
2323//
2424// :3:21: error: unable to resolve comptime value
25// :3:21: note: condition in comptime branch must be comptime known
25// :3:21: note: condition in comptime branch must be comptime-known
test/cases/x86_64-macos/assert_function.8.zig+1-1
......@@ -17,4 +17,4 @@ pub fn assert(ok: bool) void {
1717// error
1818//
1919// :5:21: error: unable to resolve comptime value
20// :5:21: note: condition in comptime branch must be comptime known
20// :5:21: note: condition in comptime branch must be comptime-known
test/compile_errors.zig+2-2
......@@ -203,8 +203,8 @@ pub fn addCases(ctx: *TestContext) !void {
203203 \\}
204204 , &[_][]const u8{
205205 ":3:12: error: unable to resolve comptime value",
206 ":3:12: note: argument to function being called at comptime must be comptime known",
207 ":2:55: note: generic function is instantiated with a comptime only return type",
206 ":3:12: note: argument to function being called at comptime must be comptime-known",
207 ":2:55: note: generic function is instantiated with a comptime-only return type",
208208 });
209209 }
210210