aboutsummaryrefslogtreecommitdiff
path: root/lib/std/builtin.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-11-23 17:51:37 -0500
committerAndrew Kelley <andrew@ziglang.org>2019-11-23 17:51:37 -0500
commitf25182f46dd672eb5b10533c67ed462a3e5df999 (patch)
tree142c56629394684cb2d7e15418dbda98ae2fd1a3 /lib/std/builtin.zig
parent7597735badd1f6aa6750f354a7e9c85fec705c55 (diff)
downloadzig-f25182f46dd672eb5b10533c67ed462a3e5df999.tar.gz
zig-f25182f46dd672eb5b10533c67ed462a3e5df999.zip
structs can have fields with type `var`
behavior tests passing now
Diffstat (limited to 'lib/std/builtin.zig')
-rw-r--r--lib/std/builtin.zig12
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/std/builtin.zig b/lib/std/builtin.zig
index 64fc68e4cc..af045c5231 100644
--- a/lib/std/builtin.zig
+++ b/lib/std/builtin.zig
@@ -146,10 +146,8 @@ pub const TypeInfo = union(enum) {
is_allowzero: 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,
+ /// to refer to that type here, so we use `var`.
+ sentinel: var,
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
@@ -168,10 +166,8 @@ pub const TypeInfo = union(enum) {
child: type,
/// 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,
+ /// to refer to that type here, so we use `var`.
+ sentinel: var,
};
/// This data structure is used by the Zig language code generation and