| author | |
| committer | |
| log | 8e2aaf6aed5213736f6cbbb374098e2394f19429 |
| tree | e7385e628e35a662f2e5595ddd5aa32b66d08168 |
| parent | 51d9db856978610c24b3fed50a9550455a2eb64b |
10 files changed, 19 insertions(+), 19 deletions(-)
lib/std/bit_set.zig+3-3| ... | @@ -23,7 +23,7 @@ | ... | @@ -23,7 +23,7 @@ |
| 23 | //! size. The interfaces of these two types match exactly, except for fields. | 23 | //! size. The interfaces of these two types match exactly, except for fields. |
| 24 | //! | 24 | //! |
| 25 | //! DynamicBitSet: | 25 | //! 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 |
| 27 | //! of usize. | 27 | //! of usize. |
| 28 | //! | 28 | //! |
| 29 | //! DynamicBitSetUnmanaged: | 29 | //! DynamicBitSetUnmanaged: |
| ... | @@ -515,7 +515,7 @@ pub fn ArrayBitSet(comptime MaskIntType: type, comptime size: usize) type { | ... | @@ -515,7 +515,7 @@ pub fn ArrayBitSet(comptime MaskIntType: type, comptime size: usize) type { |
| 515 | }; | 515 | }; |
| 516 | } | 516 | } |
| 517 | 517 | ||
| 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 |
| 519 | /// of usize. The allocator must be tracked externally by the user. | 519 | /// of usize. The allocator must be tracked externally by the user. |
| 520 | pub const DynamicBitSetUnmanaged = struct { | 520 | pub const DynamicBitSetUnmanaged = struct { |
| 521 | const Self = @This(); | 521 | const Self = @This(); |
| ... | @@ -843,7 +843,7 @@ pub const DynamicBitSetUnmanaged = struct { | ... | @@ -843,7 +843,7 @@ pub const DynamicBitSetUnmanaged = struct { |
| 843 | } | 843 | } |
| 844 | }; | 844 | }; |
| 845 | 845 | ||
| 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 |
| 847 | /// of usize. Thin wrapper around DynamicBitSetUnmanaged which keeps | 847 | /// of usize. Thin wrapper around DynamicBitSetUnmanaged which keeps |
| 848 | /// track of the allocator instance. | 848 | /// track of the allocator instance. |
| 849 | pub const DynamicBitSet = struct { | 849 | pub const DynamicBitSet = struct { |
src/Module.zig+1-1| ... | @@ -3494,7 +3494,7 @@ fn freeExportList(gpa: Allocator, export_list: []*Export) void { | ... | @@ -3494,7 +3494,7 @@ fn freeExportList(gpa: Allocator, export_list: []*Export) void { |
| 3494 | const data_has_safety_tag = @sizeOf(Zir.Inst.Data) != 8; | 3494 | const data_has_safety_tag = @sizeOf(Zir.Inst.Data) != 8; |
| 3495 | // TODO This is taking advantage of matching stage1 debug union layout. | 3495 | // TODO This is taking advantage of matching stage1 debug union layout. |
| 3496 | // We need a better language feature for initializing a union with | 3496 | // We need a better language feature for initializing a union with |
| 3497 | // a runtime known tag. | 3497 | // a runtime-known tag. |
| 3498 | const Stage1DataLayout = extern struct { | 3498 | const Stage1DataLayout = extern struct { |
| 3499 | data: [8]u8 align(@alignOf(Zir.Inst.Data)), | 3499 | data: [8]u8 align(@alignOf(Zir.Inst.Data)), |
| 3500 | safety_tag: u8, | 3500 | safety_tag: u8, |
src/Sema.zig+3-3| ... | @@ -4326,7 +4326,7 @@ fn zirValidateDeref(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileErr | ... | @@ -4326,7 +4326,7 @@ fn zirValidateDeref(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileErr |
| 4326 | const msg = try sema.errMsg( | 4326 | const msg = try sema.errMsg( |
| 4327 | block, | 4327 | block, |
| 4328 | src, | 4328 | 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", |
| 4330 | .{elem_ty.fmt(sema.mod)}, | 4330 | .{elem_ty.fmt(sema.mod)}, |
| 4331 | ); | 4331 | ); |
| 4332 | errdefer msg.destroy(sema.gpa); | 4332 | errdefer msg.destroy(sema.gpa); |
| ... | @@ -22602,7 +22602,7 @@ fn validateRuntimeElemAccess( | ... | @@ -22602,7 +22602,7 @@ fn validateRuntimeElemAccess( |
| 22602 | const msg = try sema.errMsg( | 22602 | const msg = try sema.errMsg( |
| 22603 | block, | 22603 | block, |
| 22604 | elem_index_src, | 22604 | 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", |
| 22606 | .{parent_ty.fmt(sema.mod)}, | 22606 | .{parent_ty.fmt(sema.mod)}, |
| 22607 | ); | 22607 | ); |
| 22608 | errdefer msg.destroy(sema.gpa); | 22608 | errdefer msg.destroy(sema.gpa); |
| ... | @@ -27177,7 +27177,7 @@ fn cmpNumeric( | ... | @@ -27177,7 +27177,7 @@ fn cmpNumeric( |
| 27177 | }; | 27177 | }; |
| 27178 | 27178 | ||
| 27179 | // TODO handle comparisons against lazy zero values | 27179 | // TODO handle comparisons against lazy zero values |
| 27180 | // Some values can be compared against zero without being runtime known or without forcing | 27180 | // Some values can be compared against zero without being runtime-known or without forcing |
| 27181 | // a full resolution of their value, for example `@sizeOf(@Frame(function))` is known to | 27181 | // a full resolution of their value, for example `@sizeOf(@Frame(function))` is known to |
| 27182 | // always be nonzero, and we benefit from not forcing the full evaluation and stack frame layout | 27182 | // always be nonzero, and we benefit from not forcing the full evaluation and stack frame layout |
| 27183 | // of this function if we don't need to. | 27183 | // of this function if we don't need to. |
src/arch/riscv64/CodeGen.zig+1-1| ... | @@ -1769,7 +1769,7 @@ fn airCall(self: *Self, inst: Air.Inst.Index, modifier: std.builtin.CallOptions. | ... | @@ -1769,7 +1769,7 @@ fn airCall(self: *Self, inst: Air.Inst.Index, modifier: std.builtin.CallOptions. |
| 1769 | return self.fail("TODO implement calling bitcasted functions", .{}); | 1769 | return self.fail("TODO implement calling bitcasted functions", .{}); |
| 1770 | } | 1770 | } |
| 1771 | } else { | 1771 | } else { |
| 1772 | return self.fail("TODO implement calling runtime known function pointer", .{}); | 1772 | return self.fail("TODO implement calling runtime-known function pointer", .{}); |
| 1773 | } | 1773 | } |
| 1774 | } else if (self.bin_file.cast(link.File.Coff)) |_| { | 1774 | } else if (self.bin_file.cast(link.File.Coff)) |_| { |
| 1775 | return self.fail("TODO implement calling in COFF for {}", .{self.target.cpu.arch}); | 1775 | return self.fail("TODO implement calling in COFF for {}", .{self.target.cpu.arch}); |
test/behavior/align.zig+1-1| ... | @@ -400,7 +400,7 @@ test "function callconv expression depends on generic parameter" { | ... | @@ -400,7 +400,7 @@ test "function callconv expression depends on generic parameter" { |
| 400 | comptime try S.doTheTest(); | 400 | comptime try S.doTheTest(); |
| 401 | } | 401 | } |
| 402 | 402 | ||
| 403 | test "runtime known array index has best alignment possible" { | 403 | test "runtime-known array index has best alignment possible" { |
| 404 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO | 404 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO |
| 405 | 405 | ||
| 406 | // take full advantage of over-alignment | 406 | // take full advantage of over-alignment |
test/cases/compile_errors/dereference_anyopaque.zig+4-4| ... | @@ -45,11 +45,11 @@ pub export fn entry() void { | ... | @@ -45,11 +45,11 @@ pub export fn entry() void { |
| 45 | // backend=llvm | 45 | // backend=llvm |
| 46 | // | 46 | // |
| 47 | // :11:22: error: comparison of 'void' with null | 47 | // :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 |
| 49 | // :25:51: note: opaque type 'anyopaque' has undefined size | 49 | // :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 |
| 51 | // :25:51: note: use '*const fn(*anyopaque, usize, u29, u29, usize) error{OutOfMemory}![]u8' for a function pointer type | 51 | // :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 |
| 53 | // :25:51: note: use '*const fn(*anyopaque, []u8, u29, usize, u29, usize) ?usize' for a function pointer type | 53 | // :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 |
| 55 | // :25:51: note: use '*const fn(*anyopaque, []u8, u29, usize) void' for a function pointer type | 55 | // :25:51: note: use '*const fn(*anyopaque, []u8, u29, usize) void' for a function pointer type |
test/cases/compile_errors/non-const_variables_of_things_that_require_const_variables.zig+1-1| ... | @@ -39,7 +39,7 @@ const Opaque = opaque {}; | ... | @@ -39,7 +39,7 @@ const Opaque = opaque {}; |
| 39 | // :14:8: error: variable of type 'comptime_float' must be const or comptime | 39 | // :14:8: error: variable of type 'comptime_float' must be const or comptime |
| 40 | // :14:8: note: to modify this variable at runtime, it must be given an explicit fixed-size number type | 40 | // :14:8: note: to modify this variable at runtime, it must be given an explicit fixed-size number type |
| 41 | // :18:8: error: variable of type '@TypeOf(null)' must be const or comptime | 41 | // :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 |
| 43 | // :22:19: note: opaque type 'tmp.Opaque' has undefined size | 43 | // :22:19: note: opaque type 'tmp.Opaque' has undefined size |
| 44 | // :26:8: error: variable of type 'type' must be const or comptime | 44 | // :26:8: error: variable of type 'type' must be const or comptime |
| 45 | // :26:8: note: types are not available at runtime | 45 | // :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 { | ... | @@ -11,6 +11,6 @@ export fn entry() void { |
| 11 | // backend=stage2 | 11 | // backend=stage2 |
| 12 | // target=native | 12 | // target=native |
| 13 | // | 13 | // |
| 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 |
| 15 | // :3:8: note: struct requires comptime because of this field | 15 | // :3:8: note: struct requires comptime because of this field |
| 16 | // :3:8: note: types are not available at runtime | 16 | // :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 { | ... | @@ -14,6 +14,6 @@ export fn entry() void { |
| 14 | // backend=stage2 | 14 | // backend=stage2 |
| 15 | // target=native | 15 | // target=native |
| 16 | // | 16 | // |
| 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 |
| 18 | // :?:21: note: struct requires comptime because of this field | 18 | // :?:21: note: struct requires comptime because of this field |
| 19 | // :?:21: note: types are not available at runtime | 19 | // :?: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 { | ... | @@ -24,9 +24,9 @@ pub export fn entry3() void { |
| 24 | // target=native | 24 | // target=native |
| 25 | // backend=stage2 | 25 | // backend=stage2 |
| 26 | // | 26 | // |
| 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 |
| 28 | // :7:10: note: use '*const fn() void' for a function pointer type | 28 | // :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 |
| 30 | // :15:17: note: use '*const fn() void' for a function pointer type | 30 | // :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 |
| 32 | // :21:18: note: use '*const fn() void' for a function pointer type | 32 | // :21:18: note: use '*const fn() void' for a function pointer type |