aboutsummaryrefslogtreecommitdiff
path: root/lib/std/meta
AgeCommit message (Collapse)Author
2025-04-13std: eradicate u29 and embrace std.mem.AlignmentAndrew Kelley
2025-01-16all: update to `std.builtin.Type.{Pointer,Array,StructField}` field renamesmlugg
2024-08-28std: update `std.builtin.Type` fields to follow naming conventionsmlugg
The compiler actually doesn't need any functional changes for this: Sema does reification based on the tag indices of `std.builtin.Type` already! So, no zig1.wasm update is necessary. This change is necessary to disallow name clashes between fields and decls on a type, which is a prerequisite of #9938.
2024-03-21std: promote tests to doctestsAndrew Kelley
Now these show up as "example usage" in generated documentation.
2024-03-11std.builtin: make container layout fields lowercaseTristan Ross
2024-01-09AstGen: add error for redundant comptime var in comptime scope (#18242)Bogdan Romanyuk
2023-12-08AstGen: add error for using inline loops in comptime only scopesVeikka Tuominen
2023-11-22std: remove meta.traitAndrew Kelley
In general, I don't like the idea of std.meta.trait, and so I am providing some guidance by deleting the entire namespace from the standard library and compiler codebase. My main criticism is that it's overcomplicated machinery that bloats compile times and is ultimately unnecessary given the existence of Zig's strong type system and reference traces. Users who want this can create a third party package that provides this functionality. closes #18051
2023-11-19lib: correct unnecessary uses of 'var'mlugg
2023-06-24all: migrate code to new cast builtin syntaxmlugg
Most of this migration was performed automatically with `zig fmt`. There were a few exceptions which I had to manually fix: * `@alignCast` and `@addrSpaceCast` cannot be automatically rewritten * `@truncate`'s fixup is incorrect for vectors * Test cases are not formatted, and their error locations change
2023-06-19all: zig fmt and rename "@XToY" to "@YFromX"Eric Joldasov
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-06-17mem: rename align*Generic to mem.align*Motiejus Jakštys
Anecdote 1: The generic version is way more popular than the non-generic one in Zig codebase: git grep -w alignForward | wc -l 56 git grep -w alignForwardGeneric | wc -l 149 git grep -w alignBackward | wc -l 6 git grep -w alignBackwardGeneric | wc -l 15 Anecdote 2: In my project (turbonss) that does much arithmetic and alignment I exclusively use the Generic functions. Anecdote 3: we used only the Generic versions in the Macho Man's linker workshop.
2023-06-13all: replace `comptime try` with `try comptime`Eric Joldasov
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-06-13std.meta: remove `Vector` (deprecated in 0.10)Eric Joldasov
Followup to d42d31f72f38165f70c2850e9cc63da44b3b470c. Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-04-12Zir: implement explicit block_comptime instructionmlugg
Resolves: #7056
2023-02-18update std lib and compiler sources to new for loop syntaxAndrew Kelley
2022-12-18std.builtin: remove layout field from Type.Enumr00ster91
2022-12-17std.builtin: rename Type.UnionField and Type.StructField's field_type to typer00ster91
2022-12-09Eliminate `BoundFn` type from the languageVeikka Tuominen
Closes #9484
2022-11-29std.mem.Allocator: allow shrink to failAndrew Kelley
closes #13535
2022-05-04std.meta.TrailerFlags: improve init typeErik Arvstedt
2022-05-04std.meta.TrailerFlags: include in std testsErik Arvstedt
Previously, TrailerFlags was unreferenced in std, so its tests were never run. Also, fix the use of `default_value` whose type was changed in f4a249325e8e3741a6294462ae37a79cb9089c56 (#10766).
2022-03-24std.meta.trait: remove assumption about vector ABI sizeAndrew Kelley
The unit test for hasUniqueRepresentation asserted that a vector of length 3 would not have a unique representation. This would be true if it were lowered to ABI size 8 instead of 6. However lowering it to ABI size 6 is perfectly valid depending on the target. This commit also simplifies the logic for hasUniqueRepresentation of integers.
2022-03-08deprecated TypeInfo in favor of TypeJonathan Marler
Co-authored-by: Veikka Tuominen <git@vexu.eu>
2021-11-30std lib API deprecations for the upcoming 0.9.0 releaseAndrew Kelley
See #3811
2021-10-29Make `std.meta.trait.isContainer` true for opaquesInKryption
Makes `std.meta.trait.hasFn` work as expected for opaque types with function declarations. Alternative is to add clause directly to `std.meta.trait.hasFn` to account for opaque types.
2021-10-04migrate from `std.Target.current` to `@import("builtin").target`Andrew Kelley
closes #9388 closes #9321
2021-08-24remove redundant license headers from zig standard libraryAndrew Kelley
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-07-21Correct hasUniqueRepresentation for vectorsTau
Closes #9333.
2021-06-21std.TrailerFlags: remove superfluous parameterAndrew Kelley
2021-06-21fix code broken from previous commitJacob G-W
2021-05-17Merge remote-tracking branch 'origin/master' into stage2-whole-file-astgenAndrew Kelley
Conflicts: * src/codegen/spirv.zig * src/link/SpirV.zig We're going to want to improve the stage2 test harness to print the source file name when a compile error occurs otherwise std lib contributors are going to see some confusing CI failures when they cause stage2 AstGen compile errors.
2021-05-17Remove `isIntegerNumber` and `isFloatingNumber`Aiz672
2021-05-08Merge remote-tracking branch 'origin/master' into stage2-whole-file-astgenAndrew Kelley
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-08std: update usage of std.testingVeikka Tuominen
2021-04-29std: fix compile errors found by stage2 AstGenAndrew Kelley
2021-03-18Add some enum utilitiesMartin Wickham
2021-02-24zig fmt the std libAndrew Kelley
2021-01-30Replace @TagType uses, mostly with std.meta.TagTadeo Kondrak
2021-01-02stage2: Use {s} instead of {} when formatting stringsLemonBoy
2021-01-01std: loop in trailer flags can be indexing operationdaurnimator
2021-01-01std: use FieldEnum from TrailerFlagsdaurnimator
2020-12-31Year++Frank Denis
2020-12-26Handle unions in autoHashJulius Putra Tanu Setiaji
2020-12-26Make hasUniqueRepresentation false for slicesJulius Putra Tanu Setiaji
2020-12-14std: Bool has no definite representation tooLemonBoy
The padding bits are undefined.
2020-12-14std: non-byte-multiple sized integers have no definite representationLemonBoy
Closes #7445
2020-12-10std: introduce meta.traits.is{Integral,Float}LemonBoy
2020-11-19Add builtin.Signedness, use it instead of is_signedTadeo Kondrak
2020-10-17Make std.meta.Int accept a signedness parameterJan Prudil