aboutsummaryrefslogtreecommitdiff
path: root/src/Compilation.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-10-27 19:22:40 -0700
committerAndrew Kelley <andrew@ziglang.org>2023-10-28 04:30:27 -0400
commit256ab68a97cb6a84278c78d93917ab5e8ae53209 (patch)
treeb5838383e70b6c4c0e12a053def4f2af022ec68c /src/Compilation.zig
parent9ff9ea38ea2a7dc776bb2954d31109ec1c81d191 (diff)
downloadzig-256ab68a97cb6a84278c78d93917ab5e8ae53209.tar.gz
zig-256ab68a97cb6a84278c78d93917ab5e8ae53209.zip
frontend: make Decl.zir_decl_index typed
This field had the wrong type. It's not a `Zir.Inst.Index`, it's actually a `Zir.OptionalExtraIndex`. Also, the former is currently aliased to `u32` while the latter is a nonexhaustive enum that gives us more type checking. This commit is preparation for making this field non-optional. Now it can be changed to `Zir.ExtraIndex` and then the compiler will point out all the places that the non-optional assumption is being violated.
Diffstat (limited to 'src/Compilation.zig')
-rw-r--r--src/Compilation.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig
index efc95bfe25..954acd44b7 100644
--- a/src/Compilation.zig
+++ b/src/Compilation.zig
@@ -2267,7 +2267,7 @@ pub fn update(comp: *Compilation, main_progress_node: *std.Progress.Node) !void
const decl = module.declPtr(decl_index);
assert(decl.deletion_flag);
assert(decl.dependants.count() == 0);
- assert(decl.zir_decl_index != 0);
+ assert(decl.zir_decl_index != .none);
try module.clearDecl(decl_index, null);
}