aboutsummaryrefslogtreecommitdiff
path: root/lib/std/meta
AgeCommit message (Collapse)Author
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
2020-10-01Add alignment field to TypeInfo.UnionField and TypeInfo.StructFieldTadeo Kondrak
Closes https://github.com/ziglang/zig/issues/6122
2020-09-02builtin: Add TypeInfo.StructField.is_comptimeTadeo Kondrak
2020-08-27std.meta.TrailerFlags fixesTadeo Kondrak
2020-08-27std.meta.TrailerFlags: use @Type to improve APITadeo Kondrak
- Use an enum of all field names instead of string literals - Create a struct type with all fields optional instead of relying on anonymous struct literals This should provide better type inference, compile errors, and a (subjectively) cleaner API.
2020-08-20add license header to all std lib filesAndrew Kelley
add SPDX license identifier copyright ownership is zig contributors
2020-08-14Support tuples in mem.len and trait.isIndexable (#5897)Dmitry Atamanov
2020-07-27Merge pull request #5932 from Sahnvour/hashAndrew Kelley
new trait `hasUniqueRepresentation` and hashmap speedup
2020-07-26add trait hasUniqueRepresentationSahnvour
2020-07-17Add trait.isTupledata-man
2020-07-15TrailerFlags test: fix bad alignment assumption on 32-bitAndrew Kelley
2020-07-15stage2: VarDecl and FnProto take advantage of TrailerFlags APIAndrew Kelley
These AST nodes now have a flags field and then a bunch of optional trailing objects. The end result is lower memory usage and consequently better performance. This is part of an ongoing effort to reduce the amount of memory parsed ASTs take up. Running `zig fmt` on the std lib: * cache-misses: 2,554,321 => 2,534,745 * instructions: 3,293,220,119 => 3,302,479,874 * peak memory: 74.0 MiB => 73.0 MiB Holding the entire std lib AST in memory at the same time: 93.9 MiB => 88.5 MiB
2020-07-14add std.meta.TrailerFlags APIAndrew Kelley
This is useful for saving memory when allocating an object that has many optional components. The optional objects are allocated sequentially in memory, and a single integer is used to represent each optional object and whether it is present based on each corresponding bit.
2020-07-11run zig fmt on std lib and self hostedVexu
2020-06-01Merge pull request #5449 from data-man/more_traitsAndrew Kelley
Add more traits
2020-05-28Use tuples in multiTraitdata-man
2020-05-28zig fmtdata-man
2020-05-28Added tests with tupledata-man
2020-05-27Add more traitsdata-man
2020-05-24Treat vectors as indexabledata-man
2020-03-19std lib fixups for new semanticsAndrew Kelley
std lib tests are passing now