| Age | Commit message (Collapse) | Author |
|
Adds error for taking a non comptime parameter in a function returning a
comptime-only type but not when that type is dependent on a parameter.
Co-authored-by: Veikka Tuominen <git@vexu.eu>
|
|
|
|
of generating one per invocation.
|
|
|
|
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).
|
|
|
|
This function was one of the biggest zig functions in a debug build of
the compiler.
$ bloaty stage3-debug/bin/zig -d symbols --tsv -n 10000000 |
rg -v '(llvm|clang|std|lld|\(anonymous namespace\))::|\[section ' |
sort -h -k 3
...
translate_c.ast.renderNode 86168 86219
main.buildOutputType 177959 178004
InfoTable 184832 184870
AArch64SVEIntrinsicMap 188544 188596
print_targets.cmdTargets__anon_4735 319156 319216
__static_initialization_and_destruction_0() 486666 489582
MatchTable1 621884 621997
OperandMatchTable 1139622 1139861
MatchTable0 1899764 1900141
|
|
The unit tests of std.meta depended on `@typeInfo` for the same type
returning a slice of declarations and fields with the same pointer
address. This is not something guaranteed by the language specification.
|
|
* std.meta: correct use of `default_value` in reification. stage1
accepted a wrong type for `null`.
* Sema: after instantiating a generic function, if the return type ends
up being a comptime-known type, then we return an error, undoing the
generic function instantiation, and making a comptime function call
instead.
- We also needed to clean up the dependency graph in this case.
* Sema: reified enums set tag_ty_inferred to false since an integer tag
type is provided. This is a limitation of the `@Type` builtin which
will be addressed with #10710.
* Sema: fix resolveInferredErrorSet incorrectly calling
ensureFuncBodyAnalyzed on generic functions.
|
|
|
|
Co-authored-by: Veikka Tuominen <git@vexu.eu>
|
|
prerequisite for #10705
|
|
|
|
|
|
See #3811
|
|
|
|
`testing.expect` and friends are intended to be used only in tests; this change reflects that intention.
|
|
closes #9388
closes #9321
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
Fixes #8759
|
|
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.
|
|
|
|
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.
|
|
|
|
|
|
In particular I wanted to take advantage of the new hex float parsing
code.
|
|
Function pointer alignment
|
|
std.meta: add isError
|
|
Make it return the correct value for function types and optional
pointers.
|
|
In particular I wanted the change that makes `suspend;` illegal in the
parser.
|
|
* `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
|
|
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
|
|
|
|
|
|
|
|
|
|
Includes vector types, __builtin_shufflevector, and __builtin_convertvector
|
|
|
|
|
|
Co-authored-by: Veikka Tuominen <git@vexu.eu>
|
|
|
|
|
|
|
|
|
|
|