aboutsummaryrefslogtreecommitdiff
path: root/src/value.zig
diff options
context:
space:
mode:
authorJacob G-W <jacoblevgw@gmail.com>2021-06-19 21:10:22 -0400
committerAndrew Kelley <andrew@ziglang.org>2021-06-21 17:03:03 -0700
commit9fffffb07b081858db0c2102a0680aa166b48263 (patch)
tree36caed31c5b2aaa8e08bb8e6e90e9b2c30910ff3 /src/value.zig
parentb83b3883ba0b5e965f8f7f1298c77c6d766741af (diff)
downloadzig-9fffffb07b081858db0c2102a0680aa166b48263.tar.gz
zig-9fffffb07b081858db0c2102a0680aa166b48263.zip
fix code broken from previous commit
Diffstat (limited to 'src/value.zig')
-rw-r--r--src/value.zig8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/value.zig b/src/value.zig
index 696f3d3d88..008cc3c2fe 100644
--- a/src/value.zig
+++ b/src/value.zig
@@ -626,6 +626,7 @@ pub const Value = extern union {
return std.mem.dupe(allocator, u8, payload.data);
}
if (self.castTag(.repeated)) |payload| {
+ _ = payload;
@panic("TODO implement toAllocatedBytes for this Value tag");
}
if (self.castTag(.decl_ref)) |payload| {
@@ -747,6 +748,7 @@ pub const Value = extern union {
/// Asserts the type is an enum type.
pub fn toEnum(val: Value, enum_ty: Type, comptime E: type) E {
+ _ = enum_ty;
// TODO this needs to resolve other kinds of Value tags rather than
// assuming the tag will be .enum_field_index.
const field_index = val.castTag(.enum_field_index).?.data;
@@ -935,6 +937,7 @@ pub const Value = extern union {
/// Converts an integer or a float to a float.
/// Returns `error.Overflow` if the value does not fit in the new type.
pub fn floatCast(self: Value, allocator: *Allocator, ty: Type, target: Target) !Value {
+ _ = target;
switch (ty.tag()) {
.f16 => {
@panic("TODO add __trunctfhf2 to compiler-rt");
@@ -1292,17 +1295,21 @@ pub const Value = extern union {
pub const ArrayHashContext = struct {
pub fn hash(self: @This(), v: Value) u32 {
+ _ = self;
return v.hash_u32();
}
pub fn eql(self: @This(), a: Value, b: Value) bool {
+ _ = self;
return a.eql(b);
}
};
pub const HashContext = struct {
pub fn hash(self: @This(), v: Value) u64 {
+ _ = self;
return v.hash();
}
pub fn eql(self: @This(), a: Value, b: Value) bool {
+ _ = self;
return a.eql(b);
}
};
@@ -1345,6 +1352,7 @@ pub const Value = extern union {
}
pub fn fieldValue(val: Value, allocator: *Allocator, index: usize) error{OutOfMemory}!Value {
+ _ = allocator;
switch (val.tag()) {
.@"struct" => {
const field_values = val.castTag(.@"struct").?.data;