authorgravatar for r00ster91@proton.meWooster <r00ster91@proton.me> 2022-10-05 20:58:23+02:00
committergravatar for r00ster91@proton.meWooster <r00ster91@proton.me> 2022-10-05 21:19:30+02:00
log51d9db856978610c24b3fed50a9550455a2eb64b
tree90c73872df36318779a8e23682d2d7b774ad5e19
parent654e0b6679f3436bacbf685223d6ab68f707a62f

fix(text): hyphenate "comptime" adjectives


29 files changed, 157 insertions(+), 157 deletions(-)

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///
src/Module.zig+1-1
......@@ -4584,7 +4584,7 @@ fn semaDecl(mod: *Module, decl_index: Decl.Index) !bool {
45844584 const decl_linksection: ?[*:0]const u8 = blk: {
45854585 const linksection_ref = decl.zirLinksectionRef();
45864586 if (linksection_ref == .none) break :blk null;
4587 const bytes = try sema.resolveConstString(&block_scope, section_src, linksection_ref, "linksection must be comptime known");
4587 const bytes = try sema.resolveConstString(&block_scope, section_src, linksection_ref, "linksection must be comptime-known");
45884588 if (mem.indexOfScalar(u8, bytes, 0) != null) {
45894589 return sema.fail(&block_scope, section_src, "linksection cannot contain null bytes", .{});
45904590 } else if (bytes.len == 0) {
src/Sema.zig+110-110
......@@ -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 = &.{},
......@@ -1351,7 +1351,7 @@ fn analyzeBodyInner(
13511351 const extra = sema.code.extraData(Zir.Inst.CondBr, inst_data.payload_index);
13521352 const then_body = sema.code.extra[extra.end..][0..extra.data.then_body_len];
13531353 const else_body = sema.code.extra[extra.end + then_body.len ..][0..extra.data.else_body_len];
1354 const cond = try sema.resolveInstConst(block, cond_src, extra.data.condition, "condition in comptime branch must be comptime known");
1354 const cond = try sema.resolveInstConst(block, cond_src, extra.data.condition, "condition in comptime branch must be comptime-known");
13551355 const inline_body = if (cond.val.toBool()) then_body else else_body;
13561356
13571357 try sema.maybeErrorUnwrapCondbr(block, inline_body, extra.data.condition, cond_src);
......@@ -1369,7 +1369,7 @@ fn analyzeBodyInner(
13691369 const extra = sema.code.extraData(Zir.Inst.CondBr, inst_data.payload_index);
13701370 const then_body = sema.code.extra[extra.end..][0..extra.data.then_body_len];
13711371 const else_body = sema.code.extra[extra.end + then_body.len ..][0..extra.data.else_body_len];
1372 const cond = try sema.resolveInstConst(block, cond_src, extra.data.condition, "condition in comptime branch must be comptime known");
1372 const cond = try sema.resolveInstConst(block, cond_src, extra.data.condition, "condition in comptime branch must be comptime-known");
13731373 const inline_body = if (cond.val.toBool()) then_body else else_body;
13741374 const old_runtime_index = block.runtime_index;
13751375 defer block.runtime_index = old_runtime_index;
......@@ -1391,7 +1391,7 @@ fn analyzeBodyInner(
13911391 const err_union = try sema.resolveInst(extra.data.operand);
13921392 const is_non_err = try sema.analyzeIsNonErrComptimeOnly(block, operand_src, err_union);
13931393 assert(is_non_err != .none);
1394 const is_non_err_tv = try sema.resolveInstConst(block, operand_src, is_non_err, "try operand inside comptime block must be comptime known");
1394 const is_non_err_tv = try sema.resolveInstConst(block, operand_src, is_non_err, "try operand inside comptime block must be comptime-known");
13951395 if (is_non_err_tv.val.toBool()) {
13961396 const err_union_ty = sema.typeOf(err_union);
13971397 break :blk try sema.analyzeErrUnionPayload(block, src, err_union_ty, err_union, operand_src, false);
......@@ -1447,7 +1447,7 @@ fn analyzeBodyInner(
14471447 const err_union = try sema.analyzeLoad(block, src, operand, operand_src);
14481448 const is_non_err = try sema.analyzeIsNonErrComptimeOnly(block, operand_src, err_union);
14491449 assert(is_non_err != .none);
1450 const is_non_err_tv = try sema.resolveInstConst(block, operand_src, is_non_err, "try operand inside comptime block must be comptime known");
1450 const is_non_err_tv = try sema.resolveInstConst(block, operand_src, is_non_err, "try operand inside comptime block must be comptime-known");
14511451 if (is_non_err_tv.val.toBool()) {
14521452 break :blk try sema.analyzeErrUnionPayloadPtr(block, src, operand, false, false);
14531453 }
......@@ -1592,7 +1592,7 @@ fn analyzeAsType(
15921592) !Type {
15931593 const wanted_type = Type.initTag(.@"type");
15941594 const coerced_inst = try sema.coerce(block, wanted_type, air_inst, src);
1595 const val = try sema.resolveConstValue(block, src, coerced_inst, "types must be comptime known");
1595 const val = try sema.resolveConstValue(block, src, coerced_inst, "types must be comptime-known");
15961596 var buffer: Value.ToTypeBuffer = undefined;
15971597 const ty = val.toType(&buffer);
15981598 return ty.copy(sema.arena);
......@@ -2037,7 +2037,7 @@ fn analyzeAsAlign(
20372037 src: LazySrcLoc,
20382038 air_ref: Air.Inst.Ref,
20392039) !u32 {
2040 const alignment_big = try sema.analyzeAsInt(block, src, air_ref, align_ty, "alignment must be comptime known");
2040 const alignment_big = try sema.analyzeAsInt(block, src, air_ref, align_ty, "alignment must be comptime-known");
20412041 const alignment = @intCast(u32, alignment_big); // We coerce to u16 in the prev line.
20422042 try sema.validateAlign(block, src, alignment);
20432043 return alignment;
......@@ -2711,7 +2711,7 @@ fn zirEnumDecl(
27112711 // TODO: if we need to report an error here, use a source location
27122712 // that points to this default value expression rather than the struct.
27132713 // But only resolve the source location if we need to emit a compile error.
2714 const tag_val = (try sema.resolveInstConst(block, src, tag_val_ref, "enum tag value must be comptime known")).val;
2714 const tag_val = (try sema.resolveInstConst(block, src, tag_val_ref, "enum tag value must be comptime-known")).val;
27152715 last_tag_val = tag_val;
27162716 const copied_tag_val = try tag_val.copy(decl_arena_allocator);
27172717 const gop_val = enum_obj.values.getOrPutAssumeCapacityContext(copied_tag_val, .{
......@@ -3202,7 +3202,7 @@ fn zirMakePtrConst(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileErro
32023202 var ptr_info = alloc_ty.ptrInfo().data;
32033203 const elem_ty = ptr_info.pointee_type;
32043204
3205 // Detect if all stores to an `.alloc` were comptime known.
3205 // Detect if all stores to an `.alloc` were comptime-known.
32063206 ct: {
32073207 var search_index: usize = block.instructions.items.len;
32083208 const air_tags = sema.air_instructions.items(.tag);
......@@ -3419,7 +3419,7 @@ fn zirResolveInferredAlloc(sema: *Sema, block: *Block, inst: Zir.Inst.Index) Com
34193419 if (var_is_mut) {
34203420 try sema.validateVarType(block, ty_src, final_elem_ty, false);
34213421 } else ct: {
3422 // Detect if the value is comptime known. In such case, the
3422 // Detect if the value is comptime-known. In such case, the
34233423 // last 3 AIR instructions of the block will look like this:
34243424 //
34253425 // %a = constant
......@@ -4326,7 +4326,7 @@ fn zirValidateDeref(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileErr
43264326 const msg = try sema.errMsg(
43274327 block,
43284328 src,
4329 "values of type '{}' must be comptime known, but operand value is runtime known",
4329 "values of type '{}' must be comptime-known, but operand value is runtime known",
43304330 .{elem_ty.fmt(sema.mod)},
43314331 );
43324332 errdefer msg.destroy(sema.gpa);
......@@ -4540,13 +4540,13 @@ fn storeToInferredAllocComptime(
45404540 return;
45414541 }
45424542
4543 return sema.failWithNeededComptime(block, src, "value being stored to a comptime variable must be comptime known");
4543 return sema.failWithNeededComptime(block, src, "value being stored to a comptime variable must be comptime-known");
45444544}
45454545
45464546fn zirSetEvalBranchQuota(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!void {
45474547 const inst_data = sema.code.instructions.items(.data)[inst].un_node;
45484548 const src = inst_data.src();
4549 const quota = @intCast(u32, try sema.resolveInt(block, src, inst_data.operand, Type.u32, "eval branch quota must be comptime known"));
4549 const quota = @intCast(u32, try sema.resolveInt(block, src, inst_data.operand, Type.u32, "eval branch quota must be comptime-known"));
45504550 sema.branch_quota = @maximum(sema.branch_quota, quota);
45514551}
45524552
......@@ -4699,7 +4699,7 @@ fn zirCompileError(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileErro
46994699 const inst_data = sema.code.instructions.items(.data)[inst].un_node;
47004700 const src = inst_data.src();
47014701 const operand_src: LazySrcLoc = .{ .node_offset_builtin_call_arg0 = inst_data.src_node };
4702 const msg = try sema.resolveConstString(block, operand_src, inst_data.operand, "compile error string must be comptime known");
4702 const msg = try sema.resolveConstString(block, operand_src, inst_data.operand, "compile error string must be comptime-known");
47034703 return sema.fail(block, src, "{s}", .{msg});
47044704}
47054705
......@@ -5146,7 +5146,7 @@ fn zirExportValue(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError
51465146 const src = inst_data.src();
51475147 const operand_src: LazySrcLoc = .{ .node_offset_builtin_call_arg0 = inst_data.src_node };
51485148 const options_src: LazySrcLoc = .{ .node_offset_builtin_call_arg1 = inst_data.src_node };
5149 const operand = try sema.resolveInstConst(block, operand_src, extra.operand, "export target must be comptime known");
5149 const operand = try sema.resolveInstConst(block, operand_src, extra.operand, "export target must be comptime-known");
51505150 const options = sema.resolveExportOptions(block, .unneeded, extra.options) catch |err| switch (err) {
51515151 error.NeededSourceLocation => {
51525152 _ = try sema.resolveExportOptions(block, options_src, extra.options);
......@@ -5287,7 +5287,7 @@ fn zirSetAlignStack(sema: *Sema, block: *Block, extended: Zir.Inst.Extended.Inst
52875287fn zirSetCold(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!void {
52885288 const inst_data = sema.code.instructions.items(.data)[inst].un_node;
52895289 const operand_src: LazySrcLoc = .{ .node_offset_builtin_call_arg0 = inst_data.src_node };
5290 const is_cold = try sema.resolveConstBool(block, operand_src, inst_data.operand, "operand to @setCold must be comptime known");
5290 const is_cold = try sema.resolveConstBool(block, operand_src, inst_data.operand, "operand to @setCold must be comptime-known");
52915291 const func = sema.func orelse return; // does nothing outside a function
52925292 func.is_cold = is_cold;
52935293}
......@@ -5295,13 +5295,13 @@ fn zirSetCold(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!voi
52955295fn zirSetFloatMode(sema: *Sema, block: *Block, extended: Zir.Inst.Extended.InstData) CompileError!void {
52965296 const extra = sema.code.extraData(Zir.Inst.UnNode, extended.operand).data;
52975297 const src: LazySrcLoc = .{ .node_offset_builtin_call_arg0 = extra.node };
5298 block.float_mode = try sema.resolveBuiltinEnum(block, src, extra.operand, "FloatMode", "operand to @setFloatMode must be comptime known");
5298 block.float_mode = try sema.resolveBuiltinEnum(block, src, extra.operand, "FloatMode", "operand to @setFloatMode must be comptime-known");
52995299}
53005300
53015301fn zirSetRuntimeSafety(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!void {
53025302 const inst_data = sema.code.instructions.items(.data)[inst].un_node;
53035303 const operand_src: LazySrcLoc = .{ .node_offset_builtin_call_arg0 = inst_data.src_node };
5304 block.want_safety = try sema.resolveConstBool(block, operand_src, inst_data.operand, "operand to @setRuntimeSafety must be comptime known");
5304 block.want_safety = try sema.resolveConstBool(block, operand_src, inst_data.operand, "operand to @setRuntimeSafety must be comptime-known");
53055305}
53065306
53075307fn zirFence(sema: *Sema, block: *Block, extended: Zir.Inst.Extended.InstData) CompileError!void {
......@@ -5309,7 +5309,7 @@ fn zirFence(sema: *Sema, block: *Block, extended: Zir.Inst.Extended.InstData) Co
53095309
53105310 const extra = sema.code.extraData(Zir.Inst.UnNode, extended.operand).data;
53115311 const order_src: LazySrcLoc = .{ .node_offset_builtin_call_arg0 = extra.node };
5312 const order = try sema.resolveAtomicOrder(block, order_src, extra.operand, "atomic order of @fence must be comptime known");
5312 const order = try sema.resolveAtomicOrder(block, order_src, extra.operand, "atomic order of @fence must be comptime-known");
53135313
53145314 if (@enumToInt(order) < @enumToInt(std.builtin.AtomicOrder.Acquire)) {
53155315 return sema.fail(block, order_src, "atomic ordering must be Acquire or stricter", .{});
......@@ -5946,7 +5946,7 @@ fn analyzeCall(
59465946 }
59475947
59485948 const result: Air.Inst.Ref = if (is_inline_call) res: {
5949 const func_val = sema.resolveConstValue(block, func_src, func, "function being called at comptime must be comptime known") catch |err| {
5949 const func_val = sema.resolveConstValue(block, func_src, func, "function being called at comptime must be comptime-known") catch |err| {
59505950 if (err == error.AnalysisFail and sema.err != null) {
59515951 try sema.addComptimeReturnTypeNote(block, func, func_src, func_ty_info.return_type, sema.err.?, comptime_only_ret_ty);
59525952 }
......@@ -6343,7 +6343,7 @@ fn analyzeInlineCallArg(
63436343 new_fn_info.param_types[arg_i.*] = param_ty;
63446344 const uncasted_arg = uncasted_args[arg_i.*];
63456345 if (try sema.typeRequiresComptime(param_ty)) {
6346 _ = sema.resolveConstMaybeUndefVal(arg_block, arg_src, uncasted_arg, "argument to parameter with comptime-only type must be comptime known") catch |err| {
6346 _ = sema.resolveConstMaybeUndefVal(arg_block, arg_src, uncasted_arg, "argument to parameter with comptime-only type must be comptime-known") catch |err| {
63476347 if (err == error.AnalysisFail and sema.err != null) {
63486348 try sema.addComptimeReturnTypeNote(arg_block, func, func_src, ret_ty, sema.err.?, comptime_only_ret_ty);
63496349 }
......@@ -6354,7 +6354,7 @@ fn analyzeInlineCallArg(
63546354 try sema.inst_map.putNoClobber(sema.gpa, inst, casted_arg);
63556355
63566356 if (is_comptime_call) {
6357 const arg_val = sema.resolveConstMaybeUndefVal(arg_block, arg_src, casted_arg, "argument to function being called at comptime must be comptime known") catch |err| {
6357 const arg_val = sema.resolveConstMaybeUndefVal(arg_block, arg_src, casted_arg, "argument to function being called at comptime must be comptime-known") catch |err| {
63586358 if (err == error.AnalysisFail and sema.err != null) {
63596359 try sema.addComptimeReturnTypeNote(arg_block, func, func_src, ret_ty, sema.err.?, comptime_only_ret_ty);
63606360 }
......@@ -6389,7 +6389,7 @@ fn analyzeInlineCallArg(
63896389 try sema.inst_map.putNoClobber(sema.gpa, inst, uncasted_arg);
63906390
63916391 if (is_comptime_call) {
6392 const arg_val = sema.resolveConstMaybeUndefVal(arg_block, arg_src, uncasted_arg, "argument to function being called at comptime must be comptime known") catch |err| {
6392 const arg_val = sema.resolveConstMaybeUndefVal(arg_block, arg_src, uncasted_arg, "argument to function being called at comptime must be comptime-known") catch |err| {
63936393 if (err == error.AnalysisFail and sema.err != null) {
63946394 try sema.addComptimeReturnTypeNote(arg_block, func, func_src, ret_ty, sema.err.?, comptime_only_ret_ty);
63956395 }
......@@ -6475,7 +6475,7 @@ fn instantiateGenericCall(
64756475 const mod = sema.mod;
64766476 const gpa = sema.gpa;
64776477
6478 const func_val = try sema.resolveConstValue(block, func_src, func, "generic function being called must be comptime known");
6478 const func_val = try sema.resolveConstValue(block, func_src, func, "generic function being called must be comptime-known");
64796479 const module_fn = switch (func_val.tag()) {
64806480 .function => func_val.castTag(.function).?.data,
64816481 .decl_ref => mod.declPtr(func_val.castTag(.decl_ref).?.data).val.castTag(.function).?.data,
......@@ -6967,7 +6967,7 @@ fn zirVectorType(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!
69676967 const elem_type_src: LazySrcLoc = .{ .node_offset_builtin_call_arg0 = inst_data.src_node };
69686968 const len_src: LazySrcLoc = .{ .node_offset_builtin_call_arg1 = inst_data.src_node };
69696969 const extra = sema.code.extraData(Zir.Inst.Bin, inst_data.payload_index).data;
6970 const len = try sema.resolveInt(block, len_src, extra.lhs, Type.u32, "vector length must be comptime known");
6970 const len = try sema.resolveInt(block, len_src, extra.lhs, Type.u32, "vector length must be comptime-known");
69716971 const elem_type = try sema.resolveType(block, elem_type_src, extra.rhs);
69726972 try sema.checkVectorElemType(block, elem_type_src, elem_type);
69736973 const vector_type = try Type.Tag.vector.create(sema.arena, .{
......@@ -6985,7 +6985,7 @@ fn zirArrayType(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!A
69856985 const extra = sema.code.extraData(Zir.Inst.Bin, inst_data.payload_index).data;
69866986 const len_src: LazySrcLoc = .{ .node_offset_array_type_len = inst_data.src_node };
69876987 const elem_src: LazySrcLoc = .{ .node_offset_array_type_elem = inst_data.src_node };
6988 const len = try sema.resolveInt(block, len_src, extra.lhs, Type.usize, "array length must be comptime known");
6988 const len = try sema.resolveInt(block, len_src, extra.lhs, Type.usize, "array length must be comptime-known");
69896989 const elem_type = try sema.resolveType(block, elem_src, extra.rhs);
69906990 const array_ty = try Type.array(sema.arena, len, null, elem_type, sema.mod);
69916991
......@@ -7001,11 +7001,11 @@ fn zirArrayTypeSentinel(sema: *Sema, block: *Block, inst: Zir.Inst.Index) Compil
70017001 const len_src: LazySrcLoc = .{ .node_offset_array_type_len = inst_data.src_node };
70027002 const sentinel_src: LazySrcLoc = .{ .node_offset_array_type_sentinel = inst_data.src_node };
70037003 const elem_src: LazySrcLoc = .{ .node_offset_array_type_elem = inst_data.src_node };
7004 const len = try sema.resolveInt(block, len_src, extra.len, Type.usize, "array length must be comptime known");
7004 const len = try sema.resolveInt(block, len_src, extra.len, Type.usize, "array length must be comptime-known");
70057005 const elem_type = try sema.resolveType(block, elem_src, extra.elem_type);
70067006 const uncasted_sentinel = try sema.resolveInst(extra.sentinel);
70077007 const sentinel = try sema.coerce(block, elem_type, uncasted_sentinel, sentinel_src);
7008 const sentinel_val = try sema.resolveConstValue(block, sentinel_src, sentinel, "array sentinel value must be comptime known");
7008 const sentinel_val = try sema.resolveConstValue(block, sentinel_src, sentinel, "array sentinel value must be comptime-known");
70097009 const array_ty = try Type.array(sema.arena, len, sentinel_val, elem_type, sema.mod);
70107010
70117011 return sema.addType(array_ty);
......@@ -7703,7 +7703,7 @@ fn zirFunc(
77037703 const ret_ty_body = sema.code.extra[extra_index..][0..extra.data.ret_body_len];
77047704 extra_index += ret_ty_body.len;
77057705
7706 const ret_ty_val = try sema.resolveGenericBody(block, ret_ty_src, ret_ty_body, inst, Type.type, "return type must be comptime known");
7706 const ret_ty_val = try sema.resolveGenericBody(block, ret_ty_src, ret_ty_body, inst, Type.type, "return type must be comptime-known");
77077707 var buffer: Value.ToTypeBuffer = undefined;
77087708 break :blk try ret_ty_val.toType(&buffer).copy(sema.arena);
77097709 },
......@@ -8530,7 +8530,7 @@ fn zirFieldValNamed(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileErr
85308530 const field_name_src: LazySrcLoc = .{ .node_offset_builtin_call_arg1 = inst_data.src_node };
85318531 const extra = sema.code.extraData(Zir.Inst.FieldNamed, inst_data.payload_index).data;
85328532 const object = try sema.resolveInst(extra.lhs);
8533 const field_name = try sema.resolveConstString(block, field_name_src, extra.field_name, "field name must be comptime known");
8533 const field_name = try sema.resolveConstString(block, field_name_src, extra.field_name, "field name must be comptime-known");
85348534 return sema.fieldVal(block, src, object, field_name, field_name_src);
85358535}
85368536
......@@ -8543,7 +8543,7 @@ fn zirFieldPtrNamed(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileErr
85438543 const field_name_src: LazySrcLoc = .{ .node_offset_builtin_call_arg1 = inst_data.src_node };
85448544 const extra = sema.code.extraData(Zir.Inst.FieldNamed, inst_data.payload_index).data;
85458545 const object_ptr = try sema.resolveInst(extra.lhs);
8546 const field_name = try sema.resolveConstString(block, field_name_src, extra.field_name, "field name must be comptime known");
8546 const field_name = try sema.resolveConstString(block, field_name_src, extra.field_name, "field name must be comptime-known");
85478547 return sema.fieldPtr(block, src, object_ptr, field_name, field_name_src, false);
85488548}
85498549
......@@ -8555,7 +8555,7 @@ fn zirFieldCallBindNamed(sema: *Sema, block: *Block, extended: Zir.Inst.Extended
85558555 const src = LazySrcLoc.nodeOffset(extra.node);
85568556 const field_name_src: LazySrcLoc = .{ .node_offset_builtin_call_arg1 = extra.node };
85578557 const object_ptr = try sema.resolveInst(extra.lhs);
8558 const field_name = try sema.resolveConstString(block, field_name_src, extra.field_name, "field name must be comptime known");
8558 const field_name = try sema.resolveConstString(block, field_name_src, extra.field_name, "field name must be comptime-known");
85598559 return sema.fieldCallBind(block, src, object_ptr, field_name, field_name_src);
85608560}
85618561
......@@ -10282,7 +10282,7 @@ fn resolveSwitchItemVal(
1028210282 const src = switch_prong_src.resolve(sema.gpa, sema.mod.declPtr(block.src_decl), switch_node_offset, range_expand);
1028310283 return TypedValue{
1028410284 .ty = item_ty,
10285 .val = try sema.resolveConstValue(block, src, item, "switch prong values must be comptime known"),
10285 .val = try sema.resolveConstValue(block, src, item, "switch prong values must be comptime-known"),
1028610286 };
1028710287 },
1028810288 else => |e| return e,
......@@ -10571,7 +10571,7 @@ fn zirHasField(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai
1057110571 const ty_src: LazySrcLoc = .{ .node_offset_builtin_call_arg0 = inst_data.src_node };
1057210572 const name_src: LazySrcLoc = .{ .node_offset_builtin_call_arg1 = inst_data.src_node };
1057310573 const unresolved_ty = try sema.resolveType(block, ty_src, extra.lhs);
10574 const field_name = try sema.resolveConstString(block, name_src, extra.rhs, "field name must be comptime known");
10574 const field_name = try sema.resolveConstString(block, name_src, extra.rhs, "field name must be comptime-known");
1057510575 const ty = try sema.resolveTypeFields(block, ty_src, unresolved_ty);
1057610576
1057710577 const has_field = hf: {
......@@ -10613,7 +10613,7 @@ fn zirHasDecl(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air
1061310613 const lhs_src: LazySrcLoc = .{ .node_offset_builtin_call_arg0 = inst_data.src_node };
1061410614 const rhs_src: LazySrcLoc = .{ .node_offset_builtin_call_arg1 = inst_data.src_node };
1061510615 const container_type = try sema.resolveType(block, lhs_src, extra.lhs);
10616 const decl_name = try sema.resolveConstString(block, rhs_src, extra.rhs, "decl name must be comptime known");
10616 const decl_name = try sema.resolveConstString(block, rhs_src, extra.rhs, "decl name must be comptime-known");
1061710617
1061810618 try checkNamespaceType(sema, block, lhs_src, container_type);
1061910619
......@@ -10677,7 +10677,7 @@ fn zirEmbedFile(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!A
1067710677 const mod = sema.mod;
1067810678 const inst_data = sema.code.instructions.items(.data)[inst].un_node;
1067910679 const operand_src: LazySrcLoc = .{ .node_offset_builtin_call_arg0 = inst_data.src_node };
10680 const name = try sema.resolveConstString(block, operand_src, inst_data.operand, "file path name must be comptime known");
10680 const name = try sema.resolveConstString(block, operand_src, inst_data.operand, "file path name must be comptime-known");
1068110681
1068210682 const embed_file = mod.embedFile(block.getFileScope(), name) catch |err| switch (err) {
1068310683 error.ImportOutsidePkgPath => {
......@@ -10792,7 +10792,7 @@ fn zirShl(
1079210792 if (lhs_val.isUndef()) return sema.addConstUndef(lhs_ty);
1079310793 const rhs_val = maybe_rhs_val orelse {
1079410794 if (scalar_ty.zigTypeTag() == .ComptimeInt) {
10795 return sema.fail(block, src, "LHS of shift must be a fixed-width integer type, or RHS must be a comptime known", .{});
10795 return sema.fail(block, src, "LHS of shift must be a fixed-width integer type, or RHS must be comptime-known", .{});
1079610796 }
1079710797 break :rs rhs_src;
1079810798 };
......@@ -10974,7 +10974,7 @@ fn zirShr(
1097410974 } else rhs_src;
1097510975
1097610976 if (maybe_rhs_val == null and scalar_ty.zigTypeTag() == .ComptimeInt) {
10977 return sema.fail(block, src, "LHS of shift must be a fixed-width integer type, or RHS must be a comptime known", .{});
10977 return sema.fail(block, src, "LHS of shift must be a fixed-width integer type, or RHS must be comptime-known", .{});
1097810978 }
1097910979
1098010980 try sema.requireRuntimeBlock(block, src, runtime_src);
......@@ -11244,8 +11244,8 @@ fn zirArrayCat(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai
1124411244 const rhs_sent = try sema.addConstant(rhs_info.elem_type, rhs_sent_val);
1124511245 const lhs_sent_casted = try sema.coerce(block, resolved_elem_ty, lhs_sent, lhs_src);
1124611246 const rhs_sent_casted = try sema.coerce(block, resolved_elem_ty, rhs_sent, rhs_src);
11247 const lhs_sent_casted_val = try sema.resolveConstValue(block, lhs_src, lhs_sent_casted, "array sentinel value must be comptime known");
11248 const rhs_sent_casted_val = try sema.resolveConstValue(block, rhs_src, rhs_sent_casted, "array sentinel value must be comptime known");
11247 const lhs_sent_casted_val = try sema.resolveConstValue(block, lhs_src, lhs_sent_casted, "array sentinel value must be comptime-known");
11248 const rhs_sent_casted_val = try sema.resolveConstValue(block, rhs_src, rhs_sent_casted, "array sentinel value must be comptime-known");
1124911249 if (try sema.valuesEqual(block, src, lhs_sent_casted_val, rhs_sent_casted_val, resolved_elem_ty)) {
1125011250 break :s lhs_sent_casted_val;
1125111251 } else {
......@@ -11253,14 +11253,14 @@ fn zirArrayCat(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai
1125311253 }
1125411254 } else {
1125511255 const lhs_sent_casted = try sema.coerce(block, resolved_elem_ty, lhs_sent, lhs_src);
11256 const lhs_sent_casted_val = try sema.resolveConstValue(block, lhs_src, lhs_sent_casted, "array sentinel value must be comptime known");
11256 const lhs_sent_casted_val = try sema.resolveConstValue(block, lhs_src, lhs_sent_casted, "array sentinel value must be comptime-known");
1125711257 break :s lhs_sent_casted_val;
1125811258 }
1125911259 } else {
1126011260 if (rhs_info.sentinel) |rhs_sent_val| {
1126111261 const rhs_sent = try sema.addConstant(rhs_info.elem_type, rhs_sent_val);
1126211262 const rhs_sent_casted = try sema.coerce(block, resolved_elem_ty, rhs_sent, rhs_src);
11263 const rhs_sent_casted_val = try sema.resolveConstValue(block, rhs_src, rhs_sent_casted, "array sentinel value must be comptime known");
11263 const rhs_sent_casted_val = try sema.resolveConstValue(block, rhs_src, rhs_sent_casted, "array sentinel value must be comptime-known");
1126411264 break :s rhs_sent_casted_val;
1126511265 } else {
1126611266 break :s null;
......@@ -11381,7 +11381,7 @@ fn getArrayCatInfo(sema: *Sema, block: *Block, src: LazySrcLoc, operand: Air.Ins
1138111381 // has a sentinel, and this code should compute the length based
1138211382 // on the sentinel value.
1138311383 .Slice, .Many => {
11384 const val = try sema.resolveConstValue(block, src, operand, "slice value being concatenated must be comptime known");
11384 const val = try sema.resolveConstValue(block, src, operand, "slice value being concatenated must be comptime-known");
1138511385 return Type.ArrayInfo{
1138611386 .elem_type = ptr_info.pointee_type,
1138711387 .sentinel = ptr_info.sentinel,
......@@ -11482,7 +11482,7 @@ fn zirArrayMul(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai
1148211482 const rhs_src: LazySrcLoc = .{ .node_offset_bin_rhs = inst_data.src_node };
1148311483
1148411484 // In `**` rhs must be comptime-known, but lhs can be runtime-known
11485 const factor = try sema.resolveInt(block, rhs_src, extra.rhs, Type.usize, "array multiplication factor must be comptime known");
11485 const factor = try sema.resolveInt(block, rhs_src, extra.rhs, Type.usize, "array multiplication factor must be comptime-known");
1148611486
1148711487 if (lhs_ty.isTuple()) {
1148811488 return sema.analyzeTupleMul(block, inst_data.src_node, lhs, factor);
......@@ -15812,14 +15812,14 @@ fn zirPtrType(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air
1581215812 const sentinel = if (inst_data.flags.has_sentinel) blk: {
1581315813 const ref = @intToEnum(Zir.Inst.Ref, sema.code.extra[extra_i]);
1581415814 extra_i += 1;
15815 break :blk (try sema.resolveInstConst(block, sentinel_src, ref, "pointer sentinel value must be comptime known")).val;
15815 break :blk (try sema.resolveInstConst(block, sentinel_src, ref, "pointer sentinel value must be comptime-known")).val;
1581615816 } else null;
1581715817
1581815818 const abi_align: u32 = if (inst_data.flags.has_align) blk: {
1581915819 const ref = @intToEnum(Zir.Inst.Ref, sema.code.extra[extra_i]);
1582015820 extra_i += 1;
1582115821 const coerced = try sema.coerce(block, Type.u32, try sema.resolveInst(ref), align_src);
15822 const val = try sema.resolveConstValue(block, align_src, coerced, "pointer alignment must be comptime known");
15822 const val = try sema.resolveConstValue(block, align_src, coerced, "pointer alignment must be comptime-known");
1582315823 // Check if this happens to be the lazy alignment of our element type, in
1582415824 // which case we can make this 0 without resolving it.
1582515825 if (val.castTag(.lazy_align)) |payload| {
......@@ -15841,14 +15841,14 @@ fn zirPtrType(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air
1584115841 const bit_offset = if (inst_data.flags.has_bit_range) blk: {
1584215842 const ref = @intToEnum(Zir.Inst.Ref, sema.code.extra[extra_i]);
1584315843 extra_i += 1;
15844 const bit_offset = try sema.resolveInt(block, bitoffset_src, ref, Type.u16, "pointer bit-offset must be comptime known");
15844 const bit_offset = try sema.resolveInt(block, bitoffset_src, ref, Type.u16, "pointer bit-offset must be comptime-known");
1584515845 break :blk @intCast(u16, bit_offset);
1584615846 } else 0;
1584715847
1584815848 const host_size: u16 = if (inst_data.flags.has_bit_range) blk: {
1584915849 const ref = @intToEnum(Zir.Inst.Ref, sema.code.extra[extra_i]);
1585015850 extra_i += 1;
15851 const host_size = try sema.resolveInt(block, hostsize_src, ref, Type.u16, "pointer host size must be comptime known");
15851 const host_size = try sema.resolveInt(block, hostsize_src, ref, Type.u16, "pointer host size must be comptime-known");
1585215852 break :blk @intCast(u16, host_size);
1585315853 } else 0;
1585415854
......@@ -15972,7 +15972,7 @@ fn zirUnionInit(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!A
1597215972 const init_src: LazySrcLoc = .{ .node_offset_builtin_call_arg2 = inst_data.src_node };
1597315973 const extra = sema.code.extraData(Zir.Inst.UnionInit, inst_data.payload_index).data;
1597415974 const union_ty = try sema.resolveType(block, ty_src, extra.union_type);
15975 const field_name = try sema.resolveConstString(block, field_src, extra.field_name, "name of field being initialized must be comptime known");
15975 const field_name = try sema.resolveConstString(block, field_src, extra.field_name, "name of field being initialized must be comptime-known");
1597615976 const init = try sema.resolveInst(extra.init);
1597715977 return sema.unionInit(block, init, init_src, union_ty, ty_src, field_name, field_src);
1597815978}
......@@ -16070,7 +16070,7 @@ fn zirStructInit(
1607016070 field_inits[field_index] = try sema.resolveInst(item.data.init);
1607116071 if (!is_packed) if (resolved_ty.structFieldValueComptime(field_index)) |default_value| {
1607216072 const init_val = (try sema.resolveMaybeUndefVal(block, field_src, field_inits[field_index])) orelse {
16073 return sema.failWithNeededComptime(block, field_src, "value stored in comptime field must be comptime known");
16073 return sema.failWithNeededComptime(block, field_src, "value stored in comptime field must be comptime-known");
1607416074 };
1607516075
1607616076 if (!init_val.eql(default_value, resolved_ty.structFieldType(field_index), sema.mod)) {
......@@ -16581,7 +16581,7 @@ fn zirFieldTypeRef(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileErro
1658116581 const ty_src = inst_data.src();
1658216582 const field_src = inst_data.src();
1658316583 const aggregate_ty = try sema.resolveType(block, ty_src, extra.container_type);
16584 const field_name = try sema.resolveConstString(block, field_src, extra.field_name, "field name must be comptime known");
16584 const field_name = try sema.resolveConstString(block, field_src, extra.field_name, "field name must be comptime-known");
1658516585 return sema.fieldType(block, aggregate_ty, field_name, field_src, ty_src);
1658616586}
1658716587
......@@ -16862,7 +16862,7 @@ fn zirReify(sema: *Sema, block: *Block, extended: Zir.Inst.Extended.InstData, in
1686216862 const uncasted_operand = try sema.resolveInst(extra.operand);
1686316863 const operand_src: LazySrcLoc = .{ .node_offset_builtin_call_arg0 = extra.node };
1686416864 const type_info = try sema.coerce(block, type_info_ty, uncasted_operand, operand_src);
16865 const val = try sema.resolveConstValue(block, operand_src, type_info, "operand to @Type must be comptime known");
16865 const val = try sema.resolveConstValue(block, operand_src, type_info, "operand to @Type must be comptime-known");
1686616866 const union_val = val.cast(Value.Payload.Union).?.data;
1686716867 const target = mod.getTarget();
1686816868 const tag_index = type_info_ty.unionTagFieldIndex(union_val.tag, mod).?;
......@@ -17798,7 +17798,7 @@ fn zirFloatToInt(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!
1779817798 const result_val = try sema.floatToInt(block, operand_src, val, operand_ty, dest_ty);
1779917799 return sema.addConstant(dest_ty, result_val);
1780017800 } else if (dest_ty.zigTypeTag() == .ComptimeInt) {
17801 return sema.failWithNeededComptime(block, operand_src, "value being casted to 'comptime_int' must be comptime known");
17801 return sema.failWithNeededComptime(block, operand_src, "value being casted to 'comptime_int' must be comptime-known");
1780217802 }
1780317803
1780417804 try sema.requireRuntimeBlock(block, inst_data.src(), operand_src);
......@@ -17831,7 +17831,7 @@ fn zirIntToFloat(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!
1783117831 const result_val = try val.intToFloatAdvanced(sema.arena, operand_ty, dest_ty, target, sema.kit(block, operand_src));
1783217832 return sema.addConstant(dest_ty, result_val);
1783317833 } else if (dest_ty.zigTypeTag() == .ComptimeFloat) {
17834 return sema.failWithNeededComptime(block, operand_src, "value being casted to 'comptime_float' must be comptime known");
17834 return sema.failWithNeededComptime(block, operand_src, "value being casted to 'comptime_float' must be comptime-known");
1783517835 }
1783617836
1783717837 try sema.requireRuntimeBlock(block, inst_data.src(), operand_src);
......@@ -18411,7 +18411,7 @@ fn bitOffsetOf(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!u6
1841118411 const extra = sema.code.extraData(Zir.Inst.Bin, inst_data.payload_index).data;
1841218412
1841318413 const ty = try sema.resolveType(block, lhs_src, extra.lhs);
18414 const field_name = try sema.resolveConstString(block, rhs_src, extra.rhs, "name of field must be comptime known");
18414 const field_name = try sema.resolveConstString(block, rhs_src, extra.rhs, "name of field must be comptime-known");
1841518415 const target = sema.mod.getTarget();
1841618416
1841718417 try sema.resolveTypeLayout(block, lhs_src, ty);
......@@ -18882,19 +18882,19 @@ fn resolveExportOptions(
1888218882 const visibility_src = sema.maybeOptionsSrc(block, src, "visibility");
1888318883
1888418884 const name_operand = try sema.fieldVal(block, src, options, "name", name_src);
18885 const name_val = try sema.resolveConstValue(block, name_src, name_operand, "name of exported value must be comptime known");
18885 const name_val = try sema.resolveConstValue(block, name_src, name_operand, "name of exported value must be comptime-known");
1888618886 const name_ty = Type.initTag(.const_slice_u8);
1888718887 const name = try name_val.toAllocatedBytes(name_ty, sema.arena, sema.mod);
1888818888
1888918889 const linkage_operand = try sema.fieldVal(block, src, options, "linkage", linkage_src);
18890 const linkage_val = try sema.resolveConstValue(block, linkage_src, linkage_operand, "linkage of exported value must be comptime known");
18890 const linkage_val = try sema.resolveConstValue(block, linkage_src, linkage_operand, "linkage of exported value must be comptime-known");
1889118891 const linkage = linkage_val.toEnum(std.builtin.GlobalLinkage);
1889218892
1889318893 const section = try sema.fieldVal(block, src, options, "section", section_src);
18894 const section_val = try sema.resolveConstValue(block, section_src, section, "linksection of exported value must be comptime known");
18894 const section_val = try sema.resolveConstValue(block, section_src, section, "linksection of exported value must be comptime-known");
1889518895
1889618896 const visibility_operand = try sema.fieldVal(block, src, options, "visibility", visibility_src);
18897 const visibility_val = try sema.resolveConstValue(block, visibility_src, visibility_operand, "visibility of exported value must be comptime known");
18897 const visibility_val = try sema.resolveConstValue(block, visibility_src, visibility_operand, "visibility of exported value must be comptime-known");
1889818898 const visibility = visibility_val.toEnum(std.builtin.SymbolVisibility);
1889918899
1890018900 if (name.len < 1) {
......@@ -18950,7 +18950,7 @@ fn resolveAtomicRmwOp(
1895018950 src: LazySrcLoc,
1895118951 zir_ref: Zir.Inst.Ref,
1895218952) CompileError!std.builtin.AtomicRmwOp {
18953 return resolveBuiltinEnum(sema, block, src, zir_ref, "AtomicRmwOp", "@atomicRmW operation must be comptime known");
18953 return resolveBuiltinEnum(sema, block, src, zir_ref, "AtomicRmwOp", "@atomicRmW operation must be comptime-known");
1895418954}
1895518955
1895618956fn zirCmpxchg(
......@@ -18986,8 +18986,8 @@ fn zirCmpxchg(
1898618986 const uncasted_ptr = try sema.resolveInst(extra.ptr);
1898718987 const ptr = try sema.checkAtomicPtrOperand(block, elem_ty, elem_ty_src, uncasted_ptr, ptr_src, false);
1898818988 const new_value = try sema.coerce(block, elem_ty, try sema.resolveInst(extra.new_value), new_value_src);
18989 const success_order = try sema.resolveAtomicOrder(block, success_order_src, extra.success_order, "atomic order of cmpxchg success must be comptime known");
18990 const failure_order = try sema.resolveAtomicOrder(block, failure_order_src, extra.failure_order, "atomic order of cmpxchg failure must be comptime known");
18989 const success_order = try sema.resolveAtomicOrder(block, success_order_src, extra.success_order, "atomic order of cmpxchg success must be comptime-known");
18990 const failure_order = try sema.resolveAtomicOrder(block, failure_order_src, extra.failure_order, "atomic order of cmpxchg failure must be comptime-known");
1899118991
1899218992 if (@enumToInt(success_order) < @enumToInt(std.builtin.AtomicOrder.Monotonic)) {
1899318993 return sema.fail(block, success_order_src, "success atomic ordering must be Monotonic or stricter", .{});
......@@ -19052,7 +19052,7 @@ fn zirSplat(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air.I
1905219052 const extra = sema.code.extraData(Zir.Inst.Bin, inst_data.payload_index).data;
1905319053 const len_src: LazySrcLoc = .{ .node_offset_bin_lhs = inst_data.src_node };
1905419054 const scalar_src: LazySrcLoc = .{ .node_offset_bin_rhs = inst_data.src_node };
19055 const len = @intCast(u32, try sema.resolveInt(block, len_src, extra.lhs, Type.u32, "vector splat destination length must be comptime known"));
19055 const len = @intCast(u32, try sema.resolveInt(block, len_src, extra.lhs, Type.u32, "vector splat destination length must be comptime-known"));
1905619056 const scalar = try sema.resolveInst(extra.rhs);
1905719057 const scalar_ty = sema.typeOf(scalar);
1905819058 try sema.checkVectorElemType(block, scalar_src, scalar_ty);
......@@ -19078,7 +19078,7 @@ fn zirReduce(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air.
1907819078 const extra = sema.code.extraData(Zir.Inst.Bin, inst_data.payload_index).data;
1907919079 const op_src: LazySrcLoc = .{ .node_offset_builtin_call_arg0 = inst_data.src_node };
1908019080 const operand_src: LazySrcLoc = .{ .node_offset_builtin_call_arg1 = inst_data.src_node };
19081 const operation = try sema.resolveBuiltinEnum(block, op_src, extra.lhs, "ReduceOp", "@reduce operation must be comptime known");
19081 const operation = try sema.resolveBuiltinEnum(block, op_src, extra.lhs, "ReduceOp", "@reduce operation must be comptime-known");
1908219082 const operand = try sema.resolveInst(extra.rhs);
1908319083 const operand_ty = sema.typeOf(operand);
1908419084 const target = sema.mod.getTarget();
......@@ -19165,7 +19165,7 @@ fn zirShuffle(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air
1916519165 .elem_type = Type.@"i32",
1916619166 });
1916719167 mask = try sema.coerce(block, mask_ty, mask, mask_src);
19168 const mask_val = try sema.resolveConstMaybeUndefVal(block, mask_src, mask, "shuffle mask must be comptime known");
19168 const mask_val = try sema.resolveConstMaybeUndefVal(block, mask_src, mask, "shuffle mask must be comptime-known");
1916919169 return sema.analyzeShuffle(block, inst_data.src_node, elem_ty, a, b, mask_val, @intCast(u32, mask_len));
1917019170}
1917119171
......@@ -19433,7 +19433,7 @@ fn zirAtomicLoad(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!
1943319433 const elem_ty = try sema.resolveType(block, elem_ty_src, extra.elem_type);
1943419434 const uncasted_ptr = try sema.resolveInst(extra.ptr);
1943519435 const ptr = try sema.checkAtomicPtrOperand(block, elem_ty, elem_ty_src, uncasted_ptr, ptr_src, true);
19436 const order = try sema.resolveAtomicOrder(block, order_src, extra.ordering, "atomic order of @atomicLoad must be comptime known");
19436 const order = try sema.resolveAtomicOrder(block, order_src, extra.ordering, "atomic order of @atomicLoad must be comptime-known");
1943719437
1943819438 switch (order) {
1943919439 .Release, .AcqRel => {
......@@ -19497,7 +19497,7 @@ fn zirAtomicRmw(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!A
1949719497 },
1949819498 else => {},
1949919499 }
19500 const order = try sema.resolveAtomicOrder(block, order_src, extra.ordering, "atomic order of @atomicRmW must be comptime known");
19500 const order = try sema.resolveAtomicOrder(block, order_src, extra.ordering, "atomic order of @atomicRmW must be comptime-known");
1950119501
1950219502 if (order == .Unordered) {
1950319503 return sema.fail(block, order_src, "@atomicRmw atomic ordering must not be Unordered", .{});
......@@ -19565,7 +19565,7 @@ fn zirAtomicStore(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError
1956519565 const elem_ty = sema.typeOf(operand);
1956619566 const uncasted_ptr = try sema.resolveInst(extra.ptr);
1956719567 const ptr = try sema.checkAtomicPtrOperand(block, elem_ty, elem_ty_src, uncasted_ptr, ptr_src, false);
19568 const order = try sema.resolveAtomicOrder(block, order_src, extra.ordering, "atomic order of @atomicStore must be comptime known");
19568 const order = try sema.resolveAtomicOrder(block, order_src, extra.ordering, "atomic order of @atomicStore must be comptime-known");
1956919569
1957019570 const air_tag: Air.Inst.Tag = switch (order) {
1957119571 .Acquire, .AcqRel => {
......@@ -19668,11 +19668,11 @@ fn resolveCallOptions(
1966819668 const stack_src = sema.maybeOptionsSrc(block, src, "stack");
1966919669
1967019670 const modifier = try sema.fieldVal(block, src, options, "modifier", modifier_src);
19671 const modifier_val = try sema.resolveConstValue(block, modifier_src, modifier, "call modifier must be comptime known");
19671 const modifier_val = try sema.resolveConstValue(block, modifier_src, modifier, "call modifier must be comptime-known");
1967219672 const wanted_modifier = modifier_val.toEnum(std.builtin.CallOptions.Modifier);
1967319673
1967419674 const stack = try sema.fieldVal(block, src, options, "stack", stack_src);
19675 const stack_val = try sema.resolveConstValue(block, stack_src, stack, "call stack value must be comptime known");
19675 const stack_val = try sema.resolveConstValue(block, stack_src, stack, "call stack value must be comptime-known");
1967619676
1967719677 if (!stack_val.isNull()) {
1967819678 return sema.fail(block, stack_src, "TODO: implement @call with stack", .{});
......@@ -19802,7 +19802,7 @@ fn zirFieldParentPtr(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileEr
1980219802 const ptr_src: LazySrcLoc = .{ .node_offset_builtin_call_arg2 = inst_data.src_node };
1980319803
1980419804 const struct_ty = try sema.resolveType(block, ty_src, extra.parent_type);
19805 const field_name = try sema.resolveConstString(block, name_src, extra.field_name, "field name must be comptime known");
19805 const field_name = try sema.resolveConstString(block, name_src, extra.field_name, "field name must be comptime-known");
1980619806 const field_ptr = try sema.resolveInst(extra.field_ptr);
1980719807 const field_ptr_ty = sema.typeOf(field_ptr);
1980819808
......@@ -20115,7 +20115,7 @@ fn zirVarExtended(
2011520115 uncasted_init;
2011620116
2011720117 break :blk (try sema.resolveMaybeUndefVal(block, init_src, init)) orelse
20118 return sema.failWithNeededComptime(block, init_src, "container level variable initializers must be comptime known");
20118 return sema.failWithNeededComptime(block, init_src, "container level variable initializers must be comptime-known");
2011920119 } else Value.initTag(.unreachable_value);
2012020120
2012120121 try sema.validateVarType(block, ty_src, var_ty, small.is_extern);
......@@ -20184,7 +20184,7 @@ fn zirFuncFancy(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!A
2018420184 const body = sema.code.extra[extra_index..][0..body_len];
2018520185 extra_index += body.len;
2018620186
20187 const val = try sema.resolveGenericBody(block, align_src, body, inst, Type.u29, "alignment must be comptime known");
20187 const val = try sema.resolveGenericBody(block, align_src, body, inst, Type.u29, "alignment must be comptime-known");
2018820188 if (val.tag() == .generic_poison) {
2018920189 break :blk null;
2019020190 }
......@@ -20198,7 +20198,7 @@ fn zirFuncFancy(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!A
2019820198 } else if (extra.data.bits.has_align_ref) blk: {
2019920199 const align_ref = @intToEnum(Zir.Inst.Ref, sema.code.extra[extra_index]);
2020020200 extra_index += 1;
20201 const align_tv = sema.resolveInstConst(block, align_src, align_ref, "alignment must be comptime known") catch |err| switch (err) {
20201 const align_tv = sema.resolveInstConst(block, align_src, align_ref, "alignment must be comptime-known") catch |err| switch (err) {
2020220202 error.GenericPoison => {
2020320203 break :blk null;
2020420204 },
......@@ -20220,7 +20220,7 @@ fn zirFuncFancy(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!A
2022020220 extra_index += body.len;
2022120221
2022220222 const addrspace_ty = try sema.getBuiltinType(block, addrspace_src, "AddressSpace");
20223 const val = try sema.resolveGenericBody(block, addrspace_src, body, inst, addrspace_ty, "addrespace must be comptime known");
20223 const val = try sema.resolveGenericBody(block, addrspace_src, body, inst, addrspace_ty, "addrespace must be comptime-known");
2022420224 if (val.tag() == .generic_poison) {
2022520225 break :blk null;
2022620226 }
......@@ -20228,7 +20228,7 @@ fn zirFuncFancy(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!A
2022820228 } else if (extra.data.bits.has_addrspace_ref) blk: {
2022920229 const addrspace_ref = @intToEnum(Zir.Inst.Ref, sema.code.extra[extra_index]);
2023020230 extra_index += 1;
20231 const addrspace_tv = sema.resolveInstConst(block, addrspace_src, addrspace_ref, "addrespace must be comptime known") catch |err| switch (err) {
20231 const addrspace_tv = sema.resolveInstConst(block, addrspace_src, addrspace_ref, "addrespace must be comptime-known") catch |err| switch (err) {
2023220232 error.GenericPoison => {
2023320233 break :blk null;
2023420234 },
......@@ -20243,7 +20243,7 @@ fn zirFuncFancy(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!A
2024320243 const body = sema.code.extra[extra_index..][0..body_len];
2024420244 extra_index += body.len;
2024520245
20246 const val = try sema.resolveGenericBody(block, section_src, body, inst, Type.initTag(.const_slice_u8), "linksection must be comptime known");
20246 const val = try sema.resolveGenericBody(block, section_src, body, inst, Type.initTag(.const_slice_u8), "linksection must be comptime-known");
2024720247 if (val.tag() == .generic_poison) {
2024820248 break :blk FuncLinkSection{ .generic = {} };
2024920249 }
......@@ -20251,7 +20251,7 @@ fn zirFuncFancy(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!A
2025120251 } else if (extra.data.bits.has_section_ref) blk: {
2025220252 const section_ref = @intToEnum(Zir.Inst.Ref, sema.code.extra[extra_index]);
2025320253 extra_index += 1;
20254 const section_tv = sema.resolveInstConst(block, section_src, section_ref, "linksection must be comptime known") catch |err| switch (err) {
20254 const section_tv = sema.resolveInstConst(block, section_src, section_ref, "linksection must be comptime-known") catch |err| switch (err) {
2025520255 error.GenericPoison => {
2025620256 break :blk FuncLinkSection{ .generic = {} };
2025720257 },
......@@ -20268,7 +20268,7 @@ fn zirFuncFancy(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!A
2026820268 extra_index += body.len;
2026920269
2027020270 const cc_ty = try sema.getBuiltinType(block, addrspace_src, "CallingConvention");
20271 const val = try sema.resolveGenericBody(block, cc_src, body, inst, cc_ty, "calling convention must be comptime known");
20271 const val = try sema.resolveGenericBody(block, cc_src, body, inst, cc_ty, "calling convention must be comptime-known");
2027220272 if (val.tag() == .generic_poison) {
2027320273 break :blk null;
2027420274 }
......@@ -20276,7 +20276,7 @@ fn zirFuncFancy(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!A
2027620276 } else if (extra.data.bits.has_cc_ref) blk: {
2027720277 const cc_ref = @intToEnum(Zir.Inst.Ref, sema.code.extra[extra_index]);
2027820278 extra_index += 1;
20279 const cc_tv = sema.resolveInstConst(block, cc_src, cc_ref, "calling convention must be comptime known") catch |err| switch (err) {
20279 const cc_tv = sema.resolveInstConst(block, cc_src, cc_ref, "calling convention must be comptime-known") catch |err| switch (err) {
2028020280 error.GenericPoison => {
2028120281 break :blk null;
2028220282 },
......@@ -20291,14 +20291,14 @@ fn zirFuncFancy(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!A
2029120291 const body = sema.code.extra[extra_index..][0..body_len];
2029220292 extra_index += body.len;
2029320293
20294 const val = try sema.resolveGenericBody(block, ret_src, body, inst, Type.type, "return type must be comptime known");
20294 const val = try sema.resolveGenericBody(block, ret_src, body, inst, Type.type, "return type must be comptime-known");
2029520295 var buffer: Value.ToTypeBuffer = undefined;
2029620296 const ty = try val.toType(&buffer).copy(sema.arena);
2029720297 break :blk ty;
2029820298 } else if (extra.data.bits.has_ret_ty_ref) blk: {
2029920299 const ret_ty_ref = @intToEnum(Zir.Inst.Ref, sema.code.extra[extra_index]);
2030020300 extra_index += 1;
20301 const ret_ty_tv = sema.resolveInstConst(block, ret_src, ret_ty_ref, "return type must be comptime known") catch |err| switch (err) {
20301 const ret_ty_tv = sema.resolveInstConst(block, ret_src, ret_ty_ref, "return type must be comptime-known") catch |err| switch (err) {
2030220302 error.GenericPoison => {
2030320303 break :blk Type.initTag(.generic_poison);
2030420304 },
......@@ -20354,7 +20354,7 @@ fn zirCUndef(
2035420354 const extra = sema.code.extraData(Zir.Inst.UnNode, extended.operand).data;
2035520355 const src: LazySrcLoc = .{ .node_offset_builtin_call_arg0 = extra.node };
2035620356
20357 const name = try sema.resolveConstString(block, src, extra.operand, "name of macro being undefined must be comptime known");
20357 const name = try sema.resolveConstString(block, src, extra.operand, "name of macro being undefined must be comptime-known");
2035820358 try block.c_import_buf.?.writer().print("#undefine {s}\n", .{name});
2035920359 return Air.Inst.Ref.void_value;
2036020360}
......@@ -20367,7 +20367,7 @@ fn zirCInclude(
2036720367 const extra = sema.code.extraData(Zir.Inst.UnNode, extended.operand).data;
2036820368 const src: LazySrcLoc = .{ .node_offset_builtin_call_arg0 = extra.node };
2036920369
20370 const name = try sema.resolveConstString(block, src, extra.operand, "path being included must be comptime known");
20370 const name = try sema.resolveConstString(block, src, extra.operand, "path being included must be comptime-known");
2037120371 try block.c_import_buf.?.writer().print("#include <{s}>\n", .{name});
2037220372 return Air.Inst.Ref.void_value;
2037320373}
......@@ -20381,10 +20381,10 @@ fn zirCDefine(
2038120381 const name_src: LazySrcLoc = .{ .node_offset_builtin_call_arg0 = extra.node };
2038220382 const val_src: LazySrcLoc = .{ .node_offset_builtin_call_arg1 = extra.node };
2038320383
20384 const name = try sema.resolveConstString(block, name_src, extra.lhs, "name of macro being undefined must be comptime known");
20384 const name = try sema.resolveConstString(block, name_src, extra.lhs, "name of macro being undefined must be comptime-known");
2038520385 const rhs = try sema.resolveInst(extra.rhs);
2038620386 if (sema.typeOf(rhs).zigTypeTag() != .Void) {
20387 const value = try sema.resolveConstString(block, val_src, extra.rhs, "value of macro being undefined must be comptime known");
20387 const value = try sema.resolveConstString(block, val_src, extra.rhs, "value of macro being undefined must be comptime-known");
2038820388 try block.c_import_buf.?.writer().print("#define {s} {s}\n", .{ name, value });
2038920389 } else {
2039020390 try block.c_import_buf.?.writer().print("#define {s}\n", .{name});
......@@ -20405,7 +20405,7 @@ fn zirWasmMemorySize(
2040520405 return sema.fail(block, builtin_src, "builtin @wasmMemorySize is available when targeting WebAssembly; targeted CPU architecture is {s}", .{@tagName(target.cpu.arch)});
2040620406 }
2040720407
20408 const index = @intCast(u32, try sema.resolveInt(block, index_src, extra.operand, Type.u32, "wasm memory size index must be comptime known"));
20408 const index = @intCast(u32, try sema.resolveInt(block, index_src, extra.operand, Type.u32, "wasm memory size index must be comptime-known"));
2040920409 try sema.requireRuntimeBlock(block, builtin_src, null);
2041020410 return block.addInst(.{
2041120411 .tag = .wasm_memory_size,
......@@ -20430,7 +20430,7 @@ fn zirWasmMemoryGrow(
2043020430 return sema.fail(block, builtin_src, "builtin @wasmMemoryGrow is available when targeting WebAssembly; targeted CPU architecture is {s}", .{@tagName(target.cpu.arch)});
2043120431 }
2043220432
20433 const index = @intCast(u32, try sema.resolveInt(block, index_src, extra.lhs, Type.u32, "wasm memory size index must be comptime known"));
20433 const index = @intCast(u32, try sema.resolveInt(block, index_src, extra.lhs, Type.u32, "wasm memory size index must be comptime-known"));
2043420434 const delta = try sema.coerce(block, Type.u32, try sema.resolveInst(extra.rhs), delta_src);
2043520435
2043620436 try sema.requireRuntimeBlock(block, builtin_src, null);
......@@ -20458,13 +20458,13 @@ fn resolvePrefetchOptions(
2045820458 const cache_src = sema.maybeOptionsSrc(block, src, "cache");
2045920459
2046020460 const rw = try sema.fieldVal(block, src, options, "rw", rw_src);
20461 const rw_val = try sema.resolveConstValue(block, rw_src, rw, "prefetch read/write must be comptime known");
20461 const rw_val = try sema.resolveConstValue(block, rw_src, rw, "prefetch read/write must be comptime-known");
2046220462
2046320463 const locality = try sema.fieldVal(block, src, options, "locality", locality_src);
20464 const locality_val = try sema.resolveConstValue(block, locality_src, locality, "prefetch locality must be comptime known");
20464 const locality_val = try sema.resolveConstValue(block, locality_src, locality, "prefetch locality must be comptime-known");
2046520465
2046620466 const cache = try sema.fieldVal(block, src, options, "cache", cache_src);
20467 const cache_val = try sema.resolveConstValue(block, cache_src, cache, "prefetch cache must be comptime known");
20467 const cache_val = try sema.resolveConstValue(block, cache_src, cache, "prefetch cache must be comptime-known");
2046820468
2046920469 return std.builtin.PrefetchOptions{
2047020470 .rw = rw_val.toEnum(std.builtin.PrefetchOptions.Rw),
......@@ -20524,18 +20524,18 @@ fn resolveExternOptions(
2052420524 const thread_local_src = sema.maybeOptionsSrc(block, src, "thread_local");
2052520525
2052620526 const name_ref = try sema.fieldVal(block, src, options, "name", name_src);
20527 const name_val = try sema.resolveConstValue(block, name_src, name_ref, "name of the extern symbol must be comptime known");
20527 const name_val = try sema.resolveConstValue(block, name_src, name_ref, "name of the extern symbol must be comptime-known");
2052820528 const name = try name_val.toAllocatedBytes(Type.initTag(.const_slice_u8), sema.arena, mod);
2052920529
2053020530 const library_name_inst = try sema.fieldVal(block, src, options, "library_name", library_src);
20531 const library_name_val = try sema.resolveConstValue(block, library_src, library_name_inst, "library in which extern symbol is must be comptime known");
20531 const library_name_val = try sema.resolveConstValue(block, library_src, library_name_inst, "library in which extern symbol is must be comptime-known");
2053220532
2053320533 const linkage_ref = try sema.fieldVal(block, src, options, "linkage", linkage_src);
20534 const linkage_val = try sema.resolveConstValue(block, linkage_src, linkage_ref, "linkage of the extern symbol must be comptime known");
20534 const linkage_val = try sema.resolveConstValue(block, linkage_src, linkage_ref, "linkage of the extern symbol must be comptime-known");
2053520535 const linkage = linkage_val.toEnum(std.builtin.GlobalLinkage);
2053620536
2053720537 const is_thread_local = try sema.fieldVal(block, src, options, "is_thread_local", thread_local_src);
20538 const is_thread_local_val = try sema.resolveConstValue(block, thread_local_src, is_thread_local, "threadlocality of the extern symbol must be comptime known");
20538 const is_thread_local_val = try sema.resolveConstValue(block, thread_local_src, is_thread_local, "threadlocality of the extern symbol must be comptime-known");
2053920539
2054020540 const library_name = if (!library_name_val.isNull()) blk: {
2054120541 const payload = library_name_val.castTag(.opt_payload).?.data;
......@@ -22518,7 +22518,7 @@ fn elemPtr(
2251822518 .Array, .Vector => return sema.elemPtrArray(block, src, indexable_ptr_src, indexable_ptr, elem_index_src, elem_index, init),
2251922519 .Struct => {
2252022520 // Tuple field access.
22521 const index_val = try sema.resolveConstValue(block, elem_index_src, elem_index, "tuple field access index must be comptime known");
22521 const index_val = try sema.resolveConstValue(block, elem_index_src, elem_index, "tuple field access index must be comptime-known");
2252222522 const index = @intCast(u32, index_val.toUnsignedInt(target));
2252322523 return sema.tupleFieldPtr(block, src, indexable_ptr, elem_index_src, index, init);
2252422524 },
......@@ -22580,7 +22580,7 @@ fn elemVal(
2258022580 },
2258122581 .Struct => {
2258222582 // Tuple field access.
22583 const index_val = try sema.resolveConstValue(block, elem_index_src, elem_index, "tuple field access index must be comptime known");
22583 const index_val = try sema.resolveConstValue(block, elem_index_src, elem_index, "tuple field access index must be comptime-known");
2258422584 const index = @intCast(u32, index_val.toUnsignedInt(target));
2258522585 return tupleField(sema, block, indexable_src, indexable, elem_index_src, index);
2258622586 },
......@@ -22602,7 +22602,7 @@ fn validateRuntimeElemAccess(
2260222602 const msg = try sema.errMsg(
2260322603 block,
2260422604 elem_index_src,
22605 "values of type '{}' must be comptime known, but index value is runtime known",
22605 "values of type '{}' must be comptime-known, but index value is runtime known",
2260622606 .{parent_ty.fmt(sema.mod)},
2260722607 );
2260822608 errdefer msg.destroy(sema.gpa);
......@@ -23307,7 +23307,7 @@ fn coerceExtra(
2330723307 const val = (try sema.resolveDefinedValue(block, inst_src, inst)) orelse {
2330823308 if (dest_ty.zigTypeTag() == .ComptimeInt) {
2330923309 if (!opts.report_err) return error.NotCoercible;
23310 return sema.failWithNeededComptime(block, inst_src, "value being casted to 'comptime_int' must be comptime known");
23310 return sema.failWithNeededComptime(block, inst_src, "value being casted to 'comptime_int' must be comptime-known");
2331123311 }
2331223312 break :float;
2331323313 };
......@@ -23325,7 +23325,7 @@ fn coerceExtra(
2332523325 },
2332623326 .Int, .ComptimeInt => {
2332723327 if (try sema.resolveDefinedValue(block, inst_src, inst)) |val| {
23328 // comptime known integer to other number
23328 // comptime-known integer to other number
2332923329 if (!(try sema.intFitsInType(block, inst_src, val, dest_ty, null))) {
2333023330 if (!opts.report_err) return error.NotCoercible;
2333123331 return sema.fail(block, inst_src, "type '{}' cannot represent integer value '{}'", .{ dest_ty.fmt(sema.mod), val.fmtValue(inst_ty, sema.mod) });
......@@ -23335,7 +23335,7 @@ fn coerceExtra(
2333523335 if (dest_ty.zigTypeTag() == .ComptimeInt) {
2333623336 if (!opts.report_err) return error.NotCoercible;
2333723337 if (opts.no_cast_to_comptime_int) return inst;
23338 return sema.failWithNeededComptime(block, inst_src, "value being casted to 'comptime_int' must be comptime known");
23338 return sema.failWithNeededComptime(block, inst_src, "value being casted to 'comptime_int' must be comptime-known");
2333923339 }
2334023340
2334123341 // integer widening
......@@ -23374,7 +23374,7 @@ fn coerceExtra(
2337423374 return try sema.addConstant(dest_ty, result_val);
2337523375 } else if (dest_ty.zigTypeTag() == .ComptimeFloat) {
2337623376 if (!opts.report_err) return error.NotCoercible;
23377 return sema.failWithNeededComptime(block, inst_src, "value being casted to 'comptime_float' must be comptime known");
23377 return sema.failWithNeededComptime(block, inst_src, "value being casted to 'comptime_float' must be comptime-known");
2337823378 }
2337923379
2338023380 // float widening
......@@ -23389,7 +23389,7 @@ fn coerceExtra(
2338923389 const val = (try sema.resolveDefinedValue(block, inst_src, inst)) orelse {
2339023390 if (dest_ty.zigTypeTag() == .ComptimeFloat) {
2339123391 if (!opts.report_err) return error.NotCoercible;
23392 return sema.failWithNeededComptime(block, inst_src, "value being casted to 'comptime_float' must be comptime known");
23392 return sema.failWithNeededComptime(block, inst_src, "value being casted to 'comptime_float' must be comptime-known");
2339323393 }
2339423394 break :int;
2339523395 };
......@@ -26185,7 +26185,7 @@ fn coerceTupleToStruct(
2618526185 field_refs[field_index] = coerced;
2618626186 if (field.is_comptime) {
2618726187 const init_val = (try sema.resolveMaybeUndefVal(block, field_src, coerced)) orelse {
26188 return sema.failWithNeededComptime(block, field_src, "value stored in comptime field must be comptime known");
26188 return sema.failWithNeededComptime(block, field_src, "value stored in comptime field must be comptime-known");
2618926189 };
2619026190
2619126191 if (!init_val.eql(field.default_val, field.ty, sema.mod)) {
......@@ -26281,7 +26281,7 @@ fn coerceTupleToTuple(
2628126281 field_refs[field_index] = coerced;
2628226282 if (default_val.tag() != .unreachable_value) {
2628326283 const init_val = (try sema.resolveMaybeUndefVal(block, field_src, coerced)) orelse {
26284 return sema.failWithNeededComptime(block, field_src, "value stored in comptime field must be comptime known");
26284 return sema.failWithNeededComptime(block, field_src, "value stored in comptime field must be comptime-known");
2628526285 };
2628626286
2628726287 if (!init_val.eql(default_val, field_ty, sema.mod)) {
......@@ -26647,7 +26647,7 @@ fn analyzeIsNonErrComptimeOnly(
2664726647 const maybe_operand_val = try sema.resolveMaybeUndefVal(block, src, operand);
2664826648
2664926649 // exception if the error union error set is known to be empty,
26650 // we allow the comparison but always make it comptime known.
26650 // we allow the comparison but always make it comptime-known.
2665126651 const set_ty = operand_ty.errorUnionSet();
2665226652 switch (set_ty.tag()) {
2665326653 .anyerror => {},
......@@ -26914,7 +26914,7 @@ fn analyzeSlice(
2691426914 const sentinel = s: {
2691526915 if (sentinel_opt != .none) {
2691626916 const casted = try sema.coerce(block, elem_ty, sentinel_opt, sentinel_src);
26917 break :s try sema.resolveConstValue(block, sentinel_src, casted, "slice sentinel must be comptime known");
26917 break :s try sema.resolveConstValue(block, sentinel_src, casted, "slice sentinel must be comptime-known");
2691826918 }
2691926919 // If we are slicing to the end of something that is sentinel-terminated
2692026920 // then the resulting slice type is also sentinel-terminated.
......@@ -28836,7 +28836,7 @@ fn semaStructFields(mod: *Module, struct_obj: *Module.Struct) CompileError!void
2883628836 const field = &struct_obj.fields.values()[i];
2883728837 const coerced = try sema.coerce(&block_scope, field.ty, init, src);
2883828838 const default_val = (try sema.resolveMaybeUndefVal(&block_scope, src, coerced)) orelse
28839 return sema.failWithNeededComptime(&block_scope, src, "struct field default value must be comptime known");
28839 return sema.failWithNeededComptime(&block_scope, src, "struct field default value must be comptime-known");
2884028840 field.default_val = try default_val.copy(decl_arena_allocator);
2884128841 }
2884228842 }
......@@ -29032,7 +29032,7 @@ fn semaUnionFields(mod: *Module, union_obj: *Module.Union) CompileError!void {
2903229032 if (tag_ref != .none) {
2903329033 const tag_src = src; // TODO better source location
2903429034 const coerced = try sema.coerce(&block_scope, int_tag_ty, tag_ref, tag_src);
29035 const val = try sema.resolveConstValue(&block_scope, tag_src, coerced, "enum tag value must be comptime known");
29035 const val = try sema.resolveConstValue(&block_scope, tag_src, coerced, "enum tag value must be comptime-known");
2903629036 last_tag_val = val;
2903729037
2903829038 // This puts the memory into the union arena, not the enum arena, but
......@@ -29856,7 +29856,7 @@ pub fn analyzeAddrspace(
2985629856 zir_ref: Zir.Inst.Ref,
2985729857 ctx: AddressSpaceContext,
2985829858) !std.builtin.AddressSpace {
29859 const addrspace_tv = try sema.resolveInstConst(block, src, zir_ref, "addresspace must be comptime known");
29859 const addrspace_tv = try sema.resolveInstConst(block, src, zir_ref, "addresspace must be comptime-known");
2986029860 const address_space = addrspace_tv.val.toEnum(std.builtin.AddressSpace);
2986129861 const target = sema.mod.getTarget();
2986229862 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/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);
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+1-1
......@@ -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
20// :12:13: note: argument to function being called at comptime must be comptime-known
2121// :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+1-1
......@@ -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
21// :14:13: note: argument to function being called at comptime must be comptime-known
2222// :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_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/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+1-1
......@@ -203,7 +203,7 @@ 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",
206 ":3:12: note: argument to function being called at comptime must be comptime-known",
207207 ":2:55: note: generic function is instantiated with a comptime-only return type",
208208 });
209209 }