0
Fork 0
mirror of https://codeberg.org/ziglang/zig synced 2026-11-18 07:05:05 +00:00
Commit graph

11 commits

Author SHA1 Message Date
Ennui Langeweile
83c4de13f7 Standardize error messages on "bit-packed"
Honestly, I don't even know if this is the direction to go, but considering that the term "byte-packed" and "bit-packed" have already been used before, it makes sense to me to use `bitpack` to refer to the bitpack structs and unions while using "bit-packed" when saying that something is bitpacked.
2026-11-06 20:14:04 -08:00
Ennui Langeweile
c3816e76e6 Rename packed fields to bitpack 2026-11-06 20:14:04 -08:00
Ennui Langeweile
98cc83648a Update internal naming inside tests 2026-11-06 20:14:04 -08:00
Ennui Langeweile
41bbee68df Update error messages to reflect bitpack rename 2026-11-06 20:14:04 -08:00
Ennui Langeweile
28a8c6da78 Replace packed with bitpack internally
This does not apply documentation and inner naming conventions yet.
2026-11-06 20:14:04 -08:00
Justus Klausecker
d1700a9d37 Sema: remove unnecessary coercions and type checks from comptime deref logic
`analyzeLoad` can now always assume that it's being called on a single-item
pointer.

`pointerDeref` is now split into `maybeDerefPtr` and `derefPtr`, both of
which assume that the pointer they're loading is already coerced to the
correct type. Call sites have been adjusted to now actually do that.
`maybeDerefSliceAsArray` and `derefSliceAsArray` now only work with slices
and not also with single pointers to arrays, call sites that previously
relied on that behavior now use `maybeDerefPtr` or `derefPtr` directly.

`fieldCallBind` doesn't have to check for a c pointer anymore because
ZIR `ref`/`ref_const` rl always yields a single-item pointer.
Similarly `fieldPtr` can now assume that its operand is a single-item
pointer for the same reason.

Renamed and moved some functions so that related things are next to each other.
2026-11-03 14:17:09 +01:00
Justus Klausecker
c566010559 Sema: make slices with comptime-known lengths and OPV elem types deref correctly
Basically removes a bunch of special casing for slices from the main `analyzeLoad`
code path and moves it to the new `preparePtrForDeref` function which supplants
the `verifyDeref` function. The `preparePtrForDeref` function turns slices with
comptime-known lengths into single-item pointers to arrays and is called directly
in the functions where that kind of conversion could happen. All subsequent code
now doesn't have to deal with the possibility that a derefable pointer could be a
slice anymore.
This fixes a bug where dereferencing a slice of an OPV type would result in
a single instance of that OPV type as if the slice had been a single-item
pointer to that type.
2026-11-03 13:46:38 +01:00
Jacob Young
43c0443b67 test/Runner: rework target syntax to prepare for more suites
With the number of optional components I am going to need, the
`-default-default-default-default` at the end of triple was a bit much.
2026-11-02 02:01:07 -05:00
Jacob Young
772cacefb6 test/Runner: improve skip errors and test matrices 2026-11-02 02:01:07 -05:00
Jacob Young
cc2a2eb05f test/Runner: address documentation feedback 2026-11-02 02:01:07 -05:00
Jacob Young
f0481d974e test/errors: convert compile error tests to new runner 2026-11-02 02:01:07 -05:00