commit b12a5cea7559c4cd4666f142b3e05265b07fe323 (tree) parent db799ae628cc3a131c34f8ae4b7422d7e9520cff Author: Veikka Tuominen <git@vexu.eu> Date: Thu, 27 Oct 2022 01:00:33 +0300 remove test case triggering generic deletion bug This test should be restored once the underlying issue is resolved (with the typo fixed). Diffstat:
| M | src/Module.zig | | | 1 | + |
| D | test/cases/compile_errors/generic_funciton_instantiation_inherits_parent_branch_quota.zig | | | 30 | ------------------------------ |
2 files changed, 1 insertion(+), 30 deletions(-)
diff --git a/src/Module.zig b/src/Module.zig @@ -3489,6 +3489,7 @@ pub fn destroyDecl(mod: *Module, decl_index: Decl.Index) void { const errs = mod.comp.getAllErrorsAlloc() catch break :blk; for (errs.list) |err| Compilation.AllErrors.Message.renderToStdErr(err, .no_color); } + // TODO restore test case triggering this panic @panic("Zig compiler bug: attempted to destroy declaration with an attached error"); } const decl = mod.declPtr(decl_index); diff --git a/test/cases/compile_errors/generic_funciton_instantiation_inherits_parent_branch_quota.zig b/test/cases/compile_errors/generic_funciton_instantiation_inherits_parent_branch_quota.zig @@ -1,30 +0,0 @@ -pub export fn entry1() void { - @setEvalBranchQuota(1001); - // Return type evaluation should inherit both the - // parent's branch quota and count meaning - // at least 2002 backwards branches are required. - comptime var i = 0; - inline while (i < 1000) : (i += 1) {} - _ = simple(10); -} -pub export fn entry2() void { - @setEvalBranchQuota(2001); - comptime var i = 0; - inline while (i < 1000) : (i += 1) {} - _ = simple(10); -} -fn simple(comptime n: usize) Type(n) { - return n; -} -fn Type(comptime n: usize) type { - if (n <= 1) return usize; - return Type(n - 1); -} - -// error -// backend=stage2 -// target=native -// -// :21:16: error: evaluation exceeded 1001 backwards branches -// :21:16: note: use @setEvalBranchQuota() to raise the branch limit from 1001 -// :16:34: note: called from here