21 Commits

Author SHA1 Message Date
Jay Petacat
fcc86832d6 std.enums.IndexedSet: Add initOne and initMany 2023-03-25 13:28:25 +02:00
Andrew Kelley
aeaef8c0ff update std lib and compiler sources to new for loop syntax 2023-02-18 19:17:21 -07:00
r00ster91
aac2d6b56f std.builtin: rename Type.UnionField and Type.StructField's field_type to type 2022-12-17 14:11:33 +01:00
Steven Kabbes
90477e5c10
std.IndexedSet.iterator: allow iteration on const EnumSet 2022-12-17 11:37:03 +02:00
Ronald Chen
4d23721395 std: implement subsetOf and supersetOf for EnumMultiset 2022-12-12 06:23:56 +02:00
Pyrolistical
cd9af0f286
std: add EnumMultiSet 2022-12-11 19:10:54 +02:00
Ronald Chen
a792e13fc0 std: added pure fns to EnumSet 2022-12-11 03:46:08 -05:00
r00ster91
51d9db8569 fix(text): hyphenate "comptime" adjectives 2022-10-05 21:19:30 +02:00
Jacob Young
e915b905e0 use @ptrCast to assigned generic type to default_value
If the type happens to be a pointer, then the double pointer will not
coerce implicitly.
2022-09-27 13:21:01 +03:00
Allan Regush
44c321c05e std.enums: make directEnumArrayLen public 2022-08-05 15:41:03 +03:00
Jonathan Marler
d805adddd6 deprecated TypeInfo in favor of Type
Co-authored-by: Veikka Tuominen <git@vexu.eu>
2022-03-08 20:38:12 +02:00
Andrew Kelley
f4a249325e stage1: avoid anytype fields for type info
prerequisite for #10705
2022-02-01 18:10:19 -07:00
Andrew Kelley
d29871977f remove redundant license headers from zig standard library
We already have a LICENSE file that covers the Zig Standard Library. We
no longer need to remind everyone that the license is MIT in every single
file.

Previously this was introduced to clarify the situation for a fork of
Zig that made Zig's LICENSE file harder to find, and replaced it with
their own license that required annual payments to their company.
However that fork now appears to be dead. So there is no need to
reinforce the copyright notice in every single file.
2021-08-24 12:25:09 -07:00
Jacob G-W
9fffffb07b fix code broken from previous commit 2021-06-21 17:03:03 -07:00
Jacob G-W
796b420092 std.enums: make code correct zig and not stage1 2021-06-21 17:03:02 -07:00
Andrew Kelley
5619ce2406 Merge remote-tracking branch 'origin/master' into stage2-whole-file-astgen
Conflicts:
 * doc/langref.html.in
 * lib/std/enums.zig
 * lib/std/fmt.zig
 * lib/std/hash/auto_hash.zig
 * lib/std/math.zig
 * lib/std/mem.zig
 * lib/std/meta.zig
 * test/behavior/alignof.zig
 * test/behavior/bitcast.zig
 * test/behavior/bugs/1421.zig
 * test/behavior/cast.zig
 * test/behavior/ptrcast.zig
 * test/behavior/type_info.zig
 * test/behavior/vector.zig

Master branch added `try` to a bunch of testing function calls, and some
lines also had changed how to refer to the native architecture and other
`@import("builtin")` stuff.
2021-05-08 14:45:21 -07:00
Veikka Tuominen
fd77f2cfed std: update usage of std.testing 2021-05-08 15:15:30 +03:00
Andrew Kelley
fb4cb430e0 std.enums: remove stuff for enums with field aliases
This will probably conflict with the real patch to rework this code, and
in such case this commit should be discarded in favor of the other
commit.
2021-04-29 16:05:30 -07:00
Andrew Kelley
0262dda9b8 std: remove comptime const 2021-04-22 23:52:52 -07:00
Isaac Freund
0c601965ab
stage2: make zir.Inst.Ref a non-exhaustive enum
This provides us greatly increased type safety and prevents the common
mistake of using a zir.Inst.Ref where a zir.Inst.Index was expected or
vice-versa. It also increases the ergonomics of using the typed values
which can be directly referenced with a Ref over the previous zir.Const
approach.

The main pain point is casting between a []Ref and []u32, which could be
alleviated in the future with a new std.mem function.
2021-03-24 19:11:44 +01:00
Martin Wickham
96ae451bbe Add some enum utilities 2021-03-18 14:05:01 -07:00