diff options
| author | mlugg <mlugg@mlugg.co.uk> | 2025-06-11 14:27:21 +0100 |
|---|---|---|
| committer | mlugg <mlugg@mlugg.co.uk> | 2025-06-12 17:51:30 +0100 |
| commit | d7afd797ccdeeab74946f047c3e755f33b5ea9b9 (patch) | |
| tree | 5c203e55c9c4ffaa18da83cf74f3bb19f79fac5d /src/Compilation.zig | |
| parent | 4d2b216121e5fbdb019ab8e727df654e7b08e984 (diff) | |
| download | zig-d7afd797ccdeeab74946f047c3e755f33b5ea9b9.tar.gz zig-d7afd797ccdeeab74946f047c3e755f33b5ea9b9.zip | |
Zcu: handle unreferenced `test_functions` correctly
Previously, `PerThread.populateTestFunctions` was analyzing the
`test_functions` declaration if it hadn't already been analyzed, so that
it could then populate it. However, the logic for doing this wasn't
actually correct, because it didn't trigger the necessary type
resolution. I could have tried to fix this, but there's actually a
simpler solution! If the `test_functions` declaration isn't referenced
or has a compile error, then we simply don't need to update it; either
it's unreferenced so its value doesn't matter, or we're going to get a
compile error anyway. Either way, we can just give up early. This avoids
doing semantic analysis after `performAllTheWork` finishes.
Also, get rid of the "Code Generation" progress node while updating the
test decl: this is a linking task.
Diffstat (limited to 'src/Compilation.zig')
| -rw-r--r-- | src/Compilation.zig | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index 04cd03c3d8..49b2a6b8b6 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -2817,7 +2817,7 @@ pub fn update(comp: *Compilation, main_progress_node: std.Progress.Node) !void { // The `test_functions` decl has been intentionally postponed until now, // at which point we must populate it with the list of test functions that // have been discovered and not filtered out. - try pt.populateTestFunctions(main_progress_node); + try pt.populateTestFunctions(); } try pt.processExports(); |
