aboutsummaryrefslogtreecommitdiff
path: root/src/Value.zig
diff options
context:
space:
mode:
authorwooster0 <wooster0@proton.me>2025-05-11 17:38:16 +0900
committerAlex Rønne Petersen <alex@alexrp.com>2025-05-13 07:28:41 +0200
commita365971a337116dd23df2b1bc86468d54885b4b2 (patch)
tree070dfe739796151d4d1256a3cedd83989609be42 /src/Value.zig
parenta3693aae3a9417c4298788af570762945b21ccba (diff)
downloadzig-a365971a337116dd23df2b1bc86468d54885b4b2.tar.gz
zig-a365971a337116dd23df2b1bc86468d54885b4b2.zip
std.meta.intToEnum -> std.enums.fromInt
Also use an optional as the return type instead of an error code.
Diffstat (limited to 'src/Value.zig')
-rw-r--r--src/Value.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Value.zig b/src/Value.zig
index cac4134e58..6d041bc5d2 100644
--- a/src/Value.zig
+++ b/src/Value.zig
@@ -3814,7 +3814,7 @@ pub fn interpret(val: Value, comptime T: type, pt: Zcu.PerThread) error{ OutOfMe
.@"enum" => switch (interpret_mode) {
.direct => {
const int = val.getUnsignedInt(zcu) orelse return error.TypeMismatch;
- return std.meta.intToEnum(T, int) catch error.TypeMismatch;
+ return std.enums.fromInt(T, int) orelse error.TypeMismatch;
},
.by_name => {
const field_index = ty.enumTagFieldIndex(val, zcu) orelse return error.TypeMismatch;