diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-11-23 04:45:35 -0500 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-11-23 04:45:35 -0500 |
| commit | 7597735badd1f6aa6750f354a7e9c85fec705c55 (patch) | |
| tree | 69e5e1b3795afcf065b0a40203ba4f678a4532d7 /lib/std/builtin.zig | |
| parent | 6b623b5ea2a811b54a2391f17081a8981fa733a5 (diff) | |
| download | zig-7597735badd1f6aa6750f354a7e9c85fec705c55.tar.gz zig-7597735badd1f6aa6750f354a7e9c85fec705c55.zip | |
update the stage1 implementation to the new proposal
See #3731
Diffstat (limited to 'lib/std/builtin.zig')
| -rw-r--r-- | lib/std/builtin.zig | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/std/builtin.zig b/lib/std/builtin.zig index 56c3426d8b..64fc68e4cc 100644 --- a/lib/std/builtin.zig +++ b/lib/std/builtin.zig @@ -144,7 +144,12 @@ pub const TypeInfo = union(enum) { alignment: comptime_int, child: type, is_allowzero: bool, - is_null_terminated: bool, + /// The type of the sentinel is the element type of the pointer, which is + /// the value of the `child` field in this struct. However there is no way + /// to refer to that type here, so this is a pointer to an opaque value. + /// It will be known at compile-time to be the correct type. Dereferencing + /// this pointer will work at compile-time. + sentinel: ?*const c_void, /// This data structure is used by the Zig language code generation and /// therefore must be kept in sync with the compiler implementation. @@ -161,7 +166,12 @@ pub const TypeInfo = union(enum) { pub const Array = struct { len: comptime_int, child: type, - is_null_terminated: bool, + /// The type of the sentinel is the element type of the array, which is + /// the value of the `child` field in this struct. However there is no way + /// to refer to that type here, so this is a pointer to an opaque value. + /// It will be known at compile-time to be the correct type. Dereferencing + /// this pointer will work at compile-time. + sentinel: ?*const c_void, }; /// This data structure is used by the Zig language code generation and |
