diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-04-14 10:12:45 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-04-14 10:12:45 -0700 |
| commit | 25874747174da2b0e77b3b888d0f5a13aa1a317e (patch) | |
| tree | f715cc1f2ce49c747e2e045e785673d41af3b312 /src/AstGen.zig | |
| parent | 07397707392d27fbee5f1bf0a788937b66300bf0 (diff) | |
| download | zig-25874747174da2b0e77b3b888d0f5a13aa1a317e.tar.gz zig-25874747174da2b0e77b3b888d0f5a13aa1a317e.zip | |
stage2: progress towards stage3
* The `@bitCast` workaround is removed in favor of `@ptrCast` properly
doing element casting for slice element types. This required an
enhancement both to stage1 and stage2.
* stage1 incorrectly accepts `.{}` instead of `{}`. stage2 code that
abused this is fixed.
* Make some parameters comptime to support functions in switch
expressions (as opposed to making them function pointers).
* Avoid relying on local temporaries being mutable.
* Workarounds for when stage1 and stage2 disagree on function pointer
types.
* Workaround recursive formatting bug with a `@panic("TODO")`.
* Remove unreachable `else` prongs for some inferred error sets.
All in effort towards #89.
Diffstat (limited to 'src/AstGen.zig')
| -rw-r--r-- | src/AstGen.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/AstGen.zig b/src/AstGen.zig index 75882c761b..ccce4b0bc8 100644 --- a/src/AstGen.zig +++ b/src/AstGen.zig @@ -85,12 +85,12 @@ fn reserveExtra(astgen: *AstGen, size: usize) Allocator.Error!u32 { } fn appendRefs(astgen: *AstGen, refs: []const Zir.Inst.Ref) !void { - const coerced = @bitCast([]const u32, refs); + const coerced = @ptrCast([]const u32, refs); return astgen.extra.appendSlice(astgen.gpa, coerced); } fn appendRefsAssumeCapacity(astgen: *AstGen, refs: []const Zir.Inst.Ref) void { - const coerced = @bitCast([]const u32, refs); + const coerced = @ptrCast([]const u32, refs); astgen.extra.appendSliceAssumeCapacity(coerced); } |
