aboutsummaryrefslogtreecommitdiff
path: root/lib/std/meta/trait.zig
AgeCommit message (Collapse)Author
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-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
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-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.
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-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-02stage2: Use {s} instead of {} when formatting stringsLemonBoy
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-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-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
2020-02-24remove usages of `@typeId`, `@memberCount`, `@memberName` and `@memberType`Vexu
2020-02-23remove @bytesToSlice, @sliceToBytes from tests, docsxackus
2020-02-14modernize std.metaxackus
2019-12-11self-hosted: manually parse argsAndrew Kelley
2019-12-10Replace @typeOf with @TypeOf in all zig sourceRobin Voetter
This change was mostly made with `zig fmt` and this also modified some whitespace. Note that in some files, `zig fmt` produced incorrect code, so the change was made manually.
2019-11-27remove type coercion from array values to referencesAndrew Kelley
* Implements #3768. This is a sweeping breaking change that requires many (trivial) edits to Zig source code. Array values no longer coerced to slices; however one may use `&` to obtain a reference to an array value, which may then be coerced to a slice. * Adds `IrInstruction::dump`, for debugging purposes. It's useful to call to inspect the instruction when debugging Zig IR. * Fixes bugs with result location semantics. See the new behavior test cases, and compile error test cases. * Fixes bugs with `@typeInfo` not properly resolving const values. * Behavior tests are passing but std lib tests are not yet. There is more work to do before merging this branch.
2019-11-21string literals are now null terminatedAndrew Kelley
this also deletes C string literals from the language, and then makes the std lib changes and compiler changes necessary to get the behavior tests and std lib tests passing again.