aboutsummaryrefslogtreecommitdiff
path: root/lib/std/meta.zig
AgeCommit message (Collapse)Author
2022-03-08deprecated TypeInfo in favor of TypeJonathan Marler
Co-authored-by: Veikka Tuominen <git@vexu.eu>
2022-02-01stage1: avoid anytype fields for type infoAndrew Kelley
prerequisite for #10705
2022-01-31a small crusade against std.meta.declarationsAndrew Kelley
2022-01-20std: add meta.DeclEnumMeghan Denny
2021-11-30std lib API deprecations for the upcoming 0.9.0 releaseAndrew Kelley
See #3811
2021-11-22Add std.meta.Float, alongside std.meta.IntLewis Gaul
2021-10-29Use `debug.assert` instead of `testing.expect`.InKryption
`testing.expect` and friends are intended to be used only in tests; this change reflects that intention.
2021-10-04migrate from `std.Target.current` to `@import("builtin").target`Andrew Kelley
closes #9388 closes #9321
2021-09-20Address Spaces: Pointer and function info in @TypeRobin Voetter
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-06-21fix code broken from previous commitJacob G-W
2021-06-21std, src, doc, test: remove unused variablesJacob G-W
2021-06-14translate-c: move utility functions to a separate namespaceVeikka Tuominen
2021-06-13meta.cast: handle casts from negative ints to ptrsVeikka Tuominen
2021-06-11translate-c: Implement flexible arraysEvan Haas
Fixes #8759
2021-05-12Merge remote-tracking branch 'origin/master' into stage2-whole-file-astgenAndrew Kelley
Conflicts: * lib/std/os/linux.zig * lib/std/os/windows/bits.zig * src/Module.zig * src/Sema.zig * test/stage2/test.zig Mainly I wanted Jakub's new macOS code for respecting stack size, since we now depend on it for debug builds able to pass one of the test cases for recursive comptime function calls with `@setEvalBranchQuota`. The conflicts were all trivial.
2021-05-11std.meta.Elem: support all optional typesIsaac Freund
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-04-28Merge remote-tracking branch 'origin/master' into stage2-whole-file-astgenAndrew Kelley
In particular I wanted to take advantage of the new hex float parsing code.
2021-04-25Merge pull request #8616 from LemonBoy/fn-alignAndrew Kelley
Function pointer alignment
2021-04-25Merge pull request #8496 from xackus/isErrorAndrew Kelley
std.meta: add isError
2021-04-25std: Make met.alignment work on more typesLemonBoy
Make it return the correct value for function types and optional pointers.
2021-04-24Merge remote-tracking branch 'origin/master' into stage2-whole-file-astgenAndrew Kelley
In particular I wanted the change that makes `suspend;` illegal in the parser.
2021-04-22std: fix compile errors caught by stage2 AstGenAndrew Kelley
* `comptime const` is redundant * don't use `extern enum`; specify a tag type. `extern enum` is only when you need tags to alias. But aliasing tags is a smell. I will be making a proposal shortly to remove `extern enum` from the language. * there is no such thing as `packed enum`. * instead of `catch |_|`, omit the capture entirely. * unused function definition with missing parameter name * using `try` outside of a function or test
2021-04-15translate-c: better handling of int -> enum castsEvan Haas
In std.meta.cast when casting to an enum type from an integer type, first do a C-style cast from the source value to the tag type of the enum. This ensures that we don't get an error due to the source value not being representable by the enum. In transCCast() use std.meta.cast instead of directly emitting the cast operation since the enum's underlying type may not be known at translation time due to an MSVC bug, see https://github.com/ziglang/zig/issues/8003 Fixes #6011
2021-04-15std: change `@import("builtin")` to `std.builtin`Andrew Kelley
2021-04-11zig fmtxackus
2021-04-11std.meta: add isErrorxackus
2021-04-08translate-c: fix meta.cast to ?*c_voidxackus
2021-04-06translate-c: Add support for vector expressionsEvan Haas
Includes vector types, __builtin_shufflevector, and __builtin_convertvector
2021-03-17translate-c: improve std.meta.castxackus
2021-03-05add testsxackus
2021-03-05remove redundant castMaciej Walczak
Co-authored-by: Veikka Tuominen <git@vexu.eu>
2021-03-05translate-c: promote int literals to bigger typesxackus
2021-02-24zig fmt the std libAndrew Kelley
2021-01-30Replace @TagType uses, mostly with std.meta.TagTadeo Kondrak
2021-01-30std.meta: rename TagPayloadType to TagPayloadTadeo Kondrak
2021-01-30std.meta: rename TagType to TagTadeo Kondrak
2021-01-30Fill out more cases for std.meta.sizeofMartin Wickham
2021-01-01std: have std.meta.fieldInfo take an enum rather than a stringdaurnimator
2021-01-01std: add std.meta.FieldEnumdaurnimator
2020-12-31Year++Frank Denis
2020-12-18std.crypto.random: introduce fork safetyAndrew Kelley
Everybody gets what they want! * AT_RANDOM is completely ignored. * On Linux, MADV_WIPEONFORK is used to provide fork safety. * On pthread systems, `pthread_atfork` is used to provide fork safety. * For systems that do not have the capability to provide fork safety, the implementation falls back to calling getrandom() every time. * If madvise is unavailable or returns an error, or pthread_atfork fails for whatever reason, it falls back to calling getrandom() every time. * Applications may choose to opt-out of fork safety. * Applications may choose to opt-in to unconditionally calling getrandom() for every call to std.crypto.random.fillFn. * Added `std.meta.globalOption`. * Added `std.os.madvise` and related bits. * Bumped up the size of the main thread TLS buffer. See the comment there for justification. * Simpler hot path in TLS initialization.
2020-12-09small fixes and zig fmtVexu
2020-11-29std.meta: add assumeSentinelJonathan Marler
2020-11-21std: Add test for meta.declarations on opaque{}LemonBoy
2020-11-19std.meta.declarations: support opaque {}Isaac Freund
2020-11-19Add builtin.Signedness, use it instead of is_signedTadeo Kondrak