authorgravatar for r00ster91@proton.meWooster <r00ster91@proton.me> 2023-04-23 20:06:21+02:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2023-04-23 21:06:21+03:00
logbc8e1e1de4a2f22c56528240d320f682f1ec4b69
treead2bd1a996d5cb74570e22bda1adc00c59867c08
parent658b4db223c24616a95cdf3bb3226caa23a3b50e
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

Improvements to docs and text

* docs(std.math): elaborate on difference between absCast and absInt * docs(std.rand.Random.weightedIndex): elaborate on likelihood I think this makes it easier to understand. * langref: add small reminder * docs(std.fs.path.extension): brevity * docs(std.bit_set.StaticBitSet): mention the specific types * std.debug.TTY: explain what purpose this struct serves This should also make it clearer that this struct is not supposed to provide unrelated terminal manipulation functionality such as setting the cursor position or something because terminals are complicated and we should keep this struct simple and focused on debugging. * langref(package listing): brevity * langref: explain what exactly `threadlocal` causes to happen * std.array_list: link between swapRemove and orderedRemove Maybe this can serve as a TLDR and make it easier to decide. * PrefetchOptions.locality: clarify docs that this is a range This confused me previously and I thought I can only use either 0 or 3. * fix typos and more * std.builtin.CallingConvention: document some CCs * langref: explain possibly cryptic names I think it helps knowing what exactly these acronyms (@clz and @ctz) and abbreviations (@popCount) mean. * variadic function error: add missing preposition * std.fmt.format docs: nicely hyphenate * help menu: say what to optimize for I think this is slightly more specific than just calling it "optimizations". These are speed optimizations. I used the word "performance" here.

24 files changed, 83 insertions(+), 44 deletions(-)

doc/langref.html.in+16-11
......@@ -1422,7 +1422,8 @@ fn foo() i32 {
14221422
14231423 {#header_open|Thread Local Variables#}
14241424 <p>A variable may be specified to be a thread-local variable using the
1425 {#syntax#}threadlocal{#endsyntax#} keyword:</p>
1425 {#syntax#}threadlocal{#endsyntax#} keyword,
1426 which makes each thread work with a separate instance of the variable:</p>
14261427 {#code_begin|test|test_thread_local_variables#}
14271428const std = @import("std");
14281429const assert = std.debug.assert;
......@@ -4278,7 +4279,7 @@ const expectError = std.testing.expectError;
42784279fn isFieldOptional(comptime T: type, field_index: usize) !bool {
42794280 const fields = @typeInfo(T).Struct.fields;
42804281 return switch (field_index) {
4281 // This prong is analyzed `fields.len - 1` times with `idx` being an
4282 // This prong is analyzed `fields.len - 1` times with `idx` being a
42824283 // unique comptime-known value each time.
42834284 inline 0...fields.len - 1 => |idx| @typeInfo(fields[idx].type) == .Optional,
42844285 else => return error.IndexOutOfBounds,
......@@ -8040,7 +8041,7 @@ pub const CallModifier = enum {
80408041 <p>{#syntax#}@TypeOf(operand){#endsyntax#} must be an integer type or an integer vector type.</p>
80418042 <p>{#syntax#}operand{#endsyntax#} may be an {#link|integer|Integers#} or {#link|vector|Vectors#}.</p>
80428043 <p>
8043 This function counts the number of most-significant (leading in a big-Endian sense) zeroes in an integer.
8044 Counts the number of most-significant (leading in a big-endian sense) zeroes in an integer - "count leading zeroes".
80448045 </p>
80458046 <p>
80468047 If {#syntax#}operand{#endsyntax#} is a {#link|comptime#}-known integer,
......@@ -8190,7 +8191,7 @@ test "main" {
81908191 <p>{#syntax#}@TypeOf(operand){#endsyntax#} must be an integer type or an integer vector type.</p>
81918192 <p>{#syntax#}operand{#endsyntax#} may be an {#link|integer|Integers#} or {#link|vector|Vectors#}.</p>
81928193 <p>
8193 This function counts the number of least-significant (trailing in a big-Endian sense) zeroes in an integer.
8194 Counts the number of least-significant (trailing in a big-endian sense) zeroes in an integer - "count trailing zeroes".
81948195 </p>
81958196 <p>
81968197 If {#syntax#}operand{#endsyntax#} is a {#link|comptime#}-known integer,
......@@ -8576,11 +8577,11 @@ test "@hasDecl" {
85768577 </p>
85778578 <ul>
85788579 <li>{#syntax#}@import("std"){#endsyntax#} - Zig Standard Library</li>
8579 <li>{#syntax#}@import("builtin"){#endsyntax#} - Target-specific information.
8580 <li>{#syntax#}@import("builtin"){#endsyntax#} - Target-specific information
85808581 The command <code>zig build-exe --show-builtin</code> outputs the source to stdout for reference.
85818582 </li>
8582 <li>{#syntax#}@import("root"){#endsyntax#} - Points to the root source file.
8583 This is usually <code>src/main.zig</code> but it depends on what file is chosen to be built.
8583 <li>{#syntax#}@import("root"){#endsyntax#} - Root source file
8584 This is usually <code>src/main.zig</code> but depends on what file is built.
85848585 </li>
85858586 </ul>
85868587 {#see_also|Compile Variables|@embedFile#}
......@@ -8803,7 +8804,9 @@ test "@wasmMemoryGrow" {
88038804 <pre>{#syntax#}@popCount(operand: anytype) anytype{#endsyntax#}</pre>
88048805 <p>{#syntax#}@TypeOf(operand){#endsyntax#} must be an integer type.</p>
88058806 <p>{#syntax#}operand{#endsyntax#} may be an {#link|integer|Integers#} or {#link|vector|Vectors#}.</p>
8806 <p>Counts the number of bits set in an integer.</p>
8807 <p>
8808 Counts the number of bits set in an integer - "population count".
8809 </p>
88078810 <p>
88088811 If {#syntax#}operand{#endsyntax#} is a {#link|comptime#}-known integer,
88098812 the return type is {#syntax#}comptime_int{#endsyntax#}.
......@@ -8835,6 +8838,8 @@ test "@wasmMemoryGrow" {
88358838pub const PrefetchOptions = struct {
88368839 /// Whether the prefetch should prepare for a read or a write.
88378840 rw: Rw = .read,
8841 /// The data's locality in an inclusive range from 0 to 3.
8842 ///
88388843 /// 0 means no temporal locality. That is, the data can be immediately
88398844 /// dropped from the cache after it is accessed.
88408845 ///
......@@ -8844,12 +8849,12 @@ pub const PrefetchOptions = struct {
88448849 /// The cache that the prefetch should be preformed on.
88458850 cache: Cache = .data,
88468851
8847 pub const Rw = enum {
8852 pub const Rw = enum(u1) {
88488853 read,
88498854 write,
88508855 };
88518856
8852 pub const Cache = enum {
8857 pub const Cache = enum(u1) {
88538858 instruction,
88548859 data,
88558860 };
......@@ -10971,7 +10976,7 @@ pub const MAKELOCAL = @compileError("unable to translate C expr: unexpected toke
1097110976 </p>
1097210977 <p>{#syntax#}[*c]T{#endsyntax#} - C pointer.</p>
1097310978 <ul>
10974 <li>Supports all the syntax of the other two pointer types.</li>
10979 <li>Supports all the syntax of the other two pointer types ({#syntax#}*T{#endsyntax#}) and ({#syntax#}[*]T{#endsyntax#}).</li>
1097510980 <li>Coerces to other pointer types, as well as {#link|Optional Pointers#}.
1097610981 When a C pointer is coerced to a non-optional pointer, safety-checked
1097710982 {#link|Undefined Behavior#} occurs if the address is 0.
lib/std/Build/Cache.zig+1-1
......@@ -184,7 +184,7 @@ pub const File = struct {
184184pub const HashHelper = struct {
185185 hasher: Hasher = hasher_init,
186186
187 /// Record a slice of bytes as an dependency of the process being cached
187 /// Record a slice of bytes as a dependency of the process being cached.
188188 pub fn addBytes(hh: *HashHelper, bytes: []const u8) void {
189189 hh.hasher.update(mem.asBytes(&bytes.len));
190190 hh.hasher.update(bytes);
lib/std/RingBuffer.zig+1-1
......@@ -1,7 +1,7 @@
11//! This ring buffer stores read and write indices while being able to utilise
22//! the full backing slice by incrementing the indices modulo twice the slice's
33//! length and reducing indices modulo the slice's length on slice access. This
4//! means that whether the ring buffer if full or empty can be distinguished by
4//! means that whether the ring buffer is full or empty can be distinguished by
55//! looking at the difference between the read and write indices without adding
66//! an extra boolean flag or having to reserve a slot in the buffer.
77//!
lib/std/Uri.zig+1-1
......@@ -1,4 +1,4 @@
1//! Implements URI parsing roughly adhering to <https://tools.ietf.org/html/rfc3986>.
1//! Uniform Resource Identifier (URI) parsing roughly adhering to <https://tools.ietf.org/html/rfc3986>.
22//! Does not do perfect grammar and character class checking, but should be robust against URIs in the wild.
33
44const Uri = @This();
lib/std/array_list.zig+2
......@@ -221,6 +221,7 @@ pub fn ArrayListAligned(comptime T: type, comptime alignment: ?u29) type {
221221 /// Asserts the array has at least one item.
222222 /// Invalidates pointers to end of list.
223223 /// This operation is O(N).
224 /// This preserves item order. Use `swapRemove` if order preservation is not important.
224225 pub fn orderedRemove(self: *Self, i: usize) T {
225226 const newlen = self.items.len - 1;
226227 if (newlen == i) return self.pop();
......@@ -235,6 +236,7 @@ pub fn ArrayListAligned(comptime T: type, comptime alignment: ?u29) type {
235236 /// Removes the element at the specified index and returns it.
236237 /// The empty slot is filled from the end of the list.
237238 /// This operation is O(1).
239 /// This may not preserve item order. Use `orderedRemove` if you need to preserve order.
238240 pub fn swapRemove(self: *Self, i: usize) T {
239241 if (self.items.len - 1 == i) return self.pop();
240242
lib/std/bit_set.zig+3-2
......@@ -35,9 +35,10 @@ const assert = std.debug.assert;
3535const Allocator = std.mem.Allocator;
3636
3737/// Returns the optimal static bit set type for the specified number
38/// of elements. The returned type will perform no allocations,
38/// of elements: either `IntegerBitSet` or `ArrayBitSet`,
39/// both of which fulfill the same interface.
40/// The returned type will perform no allocations,
3941/// can be copied by value, and does not require deinitialization.
40/// Both possible implementations fulfill the same interface.
4142pub fn StaticBitSet(comptime size: usize) type {
4243 if (size <= @bitSizeOf(usize)) {
4344 return IntegerBitSet(size);
lib/std/builtin.zig+27
......@@ -144,22 +144,47 @@ pub const Mode = OptimizeMode;
144144/// This data structure is used by the Zig language code generation and
145145/// therefore must be kept in sync with the compiler implementation.
146146pub const CallingConvention = enum {
147 /// This is the default Zig calling convention used when not using `export` on `fn`
148 /// and no other calling convention is specified.
147149 Unspecified,
150 /// Matches the C ABI for the target.
151 /// This is the default calling convention when using `export` on `fn`
152 /// and no other calling convention is specified.
148153 C,
154 /// This makes a function not have any function prologue or epilogue,
155 /// making the function itself uncallable in regular Zig code.
156 /// This can be useful when integrating with assembly.
149157 Naked,
158 /// Functions with this calling convention are called asynchronously,
159 /// as if called as `async function()`.
150160 Async,
161 /// Functions with this calling convention are inlined at all call sites.
151162 Inline,
163 /// x86-only.
152164 Interrupt,
153165 Signal,
166 /// x86-only.
154167 Stdcall,
168 /// x86-only.
155169 Fastcall,
170 /// x86-only.
156171 Vectorcall,
172 /// x86-only.
157173 Thiscall,
174 /// ARM Procedure Call Standard (obsolete)
175 /// ARM-only.
158176 APCS,
177 /// ARM Architecture Procedure Call Standard (current standard)
178 /// ARM-only.
159179 AAPCS,
180 /// ARM Architecture Procedure Call Standard Vector Floating-Point
181 /// ARM-only.
160182 AAPCSVFP,
183 /// x86-64-only.
161184 SysV,
185 /// x86-64-only.
162186 Win64,
187 /// AMD GPU, NVPTX, or SPIR-V kernel
163188 Kernel,
164189};
165190
......@@ -716,6 +741,8 @@ pub const VaList = switch (builtin.cpu.arch) {
716741pub const PrefetchOptions = struct {
717742 /// Whether the prefetch should prepare for a read or a write.
718743 rw: Rw = .read,
744 /// The data's locality in an inclusive range from 0 to 3.
745 ///
719746 /// 0 means no temporal locality. That is, the data can be immediately
720747 /// dropped from the cache after it is accessed.
721748 ///
lib/std/compress/zstandard.zig+1-1
......@@ -10,7 +10,7 @@ pub const decompress = @import("zstandard/decompress.zig");
1010
1111pub const DecompressStreamOptions = struct {
1212 verify_checksum: bool = true,
13 window_size_max: usize = 1 << 23, // 8MiB default maximum window size,
13 window_size_max: usize = 1 << 23, // 8MiB default maximum window size
1414};
1515
1616pub fn DecompressStream(
lib/std/compress/zstandard/decode/fse.zig+1-1
......@@ -21,7 +21,7 @@ pub fn decodeFseTable(
2121 var accumulated_probability: u16 = 0;
2222
2323 while (accumulated_probability < total_probability) {
24 // WARNING: The RFC in poorly worded, and would suggest std.math.log2_int_ceil is correct here,
24 // WARNING: The RFC is poorly worded, and would suggest std.math.log2_int_ceil is correct here,
2525 // but power of two (remaining probabilities + 1) need max bits set to 1 more.
2626 const max_bits = std.math.log2_int(u16, total_probability - accumulated_probability + 1) + 1;
2727 const small = try bit_reader.readBitsNoEof(u16, max_bits - 1);
lib/std/debug.zig+2
......@@ -651,6 +651,8 @@ pub fn writeCurrentStackTraceWindows(
651651 }
652652}
653653
654/// Provides simple functionality for manipulating the terminal in some way,
655/// for debugging purposes, such as coloring text, etc.
654656pub const TTY = struct {
655657 pub const Color = enum {
656658 Red,
lib/std/fmt.zig+1-1
......@@ -41,7 +41,7 @@ pub const FormatOptions = struct {
4141/// brackets, e.g. {[score]...} as opposed to the numeric index form which can be written e.g. {2...}
4242/// - *specifier* is a type-dependent formatting option that determines how a type should formatted (see below)
4343/// - *fill* is a single character which is used to pad the formatted text
44/// - *alignment* is one of the three characters `<`, `^` or `>`. they define if the text is *left*, *center*, or *right* aligned
44/// - *alignment* is one of the three characters `<`, `^`, or `>` to make the text left-, center-, or right-aligned, respectively
4545/// - *width* is the total width of the field in characters
4646/// - *precision* specifies how many decimals a formatted number should have
4747///
lib/std/fs/path.zig+3-4
......@@ -1214,10 +1214,9 @@ fn testRelativeWindows(from: []const u8, to: []const u8, expected_output: []cons
12141214 try testing.expectEqualStrings(expected_output, result);
12151215}
12161216
1217/// Returns the extension of the file name (if any).
1218/// This function will search for the file extension (separated by a `.`) and will return the text after the `.`.
1219/// Files that end with `.`, or that start with `.` and have no other `.` in their name,
1220/// are considered to have no extension.
1217/// Searches for a file extension separated by a `.` and returns the string after that `.`.
1218/// Files that end or start with `.` and have no other `.` in their name
1219/// are considered to have no extension, in which case this returns "".
12211220/// Examples:
12221221/// - `"main.zig"` ⇒ `".zig"`
12231222/// - `"src/main.zig"` ⇒ `".zig"`
lib/std/macho.zig+2-2
......@@ -540,13 +540,13 @@ pub const dylib_command = extern struct {
540540 dylib: dylib,
541541};
542542
543/// Dynamicaly linked shared libraries are identified by two things. The
543/// Dynamically linked shared libraries are identified by two things. The
544544/// pathname (the name of the library as found for execution), and the
545545/// compatibility version number. The pathname must match and the compatibility
546546/// number in the user of the library must be greater than or equal to the
547547/// library being used. The time stamp is used to record the time a library was
548548/// built and copied into user so it can be use to determined if the library used
549/// at runtime is exactly the same as used to built the program.
549/// at runtime is exactly the same as used to build the program.
550550pub const dylib = extern struct {
551551 /// library's pathname (offset pointing at the end of dylib_command)
552552 name: u32,
lib/std/math.zig+4-3
......@@ -782,7 +782,8 @@ fn testOverflow() !void {
782782}
783783
784784/// Returns the absolute value of x, where x is a value of a signed integer type.
785/// See also: `absCast`
785/// Does not convert and returns a value of a signed integer type.
786/// Use `absCast` if you want to convert the result and get an unsigned type.
786787pub fn absInt(x: anytype) !@TypeOf(x) {
787788 const T = @TypeOf(x);
788789 return switch (@typeInfo(T)) {
......@@ -1015,8 +1016,8 @@ pub inline fn fabs(value: anytype) @TypeOf(value) {
10151016}
10161017
10171018/// Returns the absolute value of the integer parameter.
1018/// Result is an unsigned integer.
1019/// See also: `absInt`
1019/// Converts result type to unsigned if needed and returns a value of an unsigned integer type.
1020/// Use `absInt` if you want to keep your integer type signed.
10201021pub fn absCast(x: anytype) switch (@typeInfo(@TypeOf(x))) {
10211022 .ComptimeInt => comptime_int,
10221023 .Int => |int_info| std.meta.Int(.unsigned, int_info.bits),
lib/std/mem.zig+1-1
......@@ -227,7 +227,7 @@ pub fn set(comptime T: type, dest: []T, value: T) void {
227227/// interfacing with a C API where this practice is more common and relied upon. If you are performing code review and see this
228228/// function used, examine closely - it may be a code smell.
229229/// Zero initializes the type.
230/// This can be used to zero initialize a any type for which it makes sense. Structs will be initialized recursively.
230/// This can be used to zero-initialize any type for which it makes sense. Structs will be initialized recursively.
231231pub fn zeroes(comptime T: type) T {
232232 switch (@typeInfo(T)) {
233233 .ComptimeInt, .Int, .ComptimeFloat, .Float => {
lib/std/os/linux/seccomp.zig+1-1
......@@ -20,7 +20,7 @@
2020//!
2121//! 1. Each CPU architecture supported by Linux has its own unique ABI and
2222//! syscall API. It is not guaranteed that the syscall numbers and arguments
23//! are the same across architectures, or that they're even implemted. Thus,
23//! are the same across architectures, or that they're even implemented. Thus,
2424//! filters cannot be assumed to be portable without consulting documentation
2525//! like syscalls(2) and testing on target hardware. This also requires
2626//! checking the value of `data.arch` to make sure that a filter was compiled
lib/std/rand.zig+2
......@@ -389,6 +389,8 @@ pub const Random = struct {
389389
390390 /// Randomly selects an index into `proportions`, where the likelihood of each
391391 /// index is weighted by that proportion.
392 /// It is more likely for the index of the last proportion to be returned
393 /// than the index of the first proportion in the slice, and vice versa.
392394 ///
393395 /// This is useful for selecting an item from a slice where weights are not equal.
394396 /// `T` must be a numeric type capable of holding the sum of `proportions`.
src/Air.zig+1-1
......@@ -681,7 +681,7 @@ pub const Inst = struct {
681681 /// Uses the `un_op` field.
682682 tag_name,
683683
684 /// Given an error value, return the error name. Result type is always `[:0] const u8`.
684 /// Given an error value, return the error name. Result type is always `[:0]const u8`.
685685 /// Uses the `un_op` field.
686686 error_name,
687687
src/Autodoc.zig+2-2
......@@ -4076,7 +4076,7 @@ fn analyzeFancyFunction(
40764076 else => null,
40774077 };
40784078
4079 // if we're analyzing a funcion signature (ie without body), we
4079 // if we're analyzing a function signature (ie without body), we
40804080 // actually don't have an ast_node reserved for us, but since
40814081 // we don't have a name, we don't need it.
40824082 const src = if (fn_info.body.len == 0) 0 else self_ast_node_index;
......@@ -4229,7 +4229,7 @@ fn analyzeFunction(
42294229 } else break :blk ret_type_ref;
42304230 };
42314231
4232 // if we're analyzing a funcion signature (ie without body), we
4232 // if we're analyzing a function signature (ie without body), we
42334233 // actually don't have an ast_node reserved for us, but since
42344234 // we don't have a name, we don't need it.
42354235 const src = if (fn_info.body.len == 0) 0 else self_ast_node_index;
src/Sema.zig+5-5
......@@ -4155,7 +4155,7 @@ fn validateUnionInit(
41554155 const msg = try sema.errMsg(
41564156 block,
41574157 init_src,
4158 "cannot initialize multiple union fields at once, unions can only have one active field",
4158 "cannot initialize multiple union fields at once; unions can only have one active field",
41594159 .{},
41604160 );
41614161 errdefer msg.destroy(sema.gpa);
......@@ -9646,7 +9646,7 @@ fn zirBitcast(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air
96469646 .Union => "union",
96479647 else => unreachable,
96489648 };
9649 return sema.fail(block, dest_ty_src, "cannot @bitCast to '{}', {s} does not have a guaranteed in-memory layout", .{
9649 return sema.fail(block, dest_ty_src, "cannot @bitCast to '{}'; {s} does not have a guaranteed in-memory layout", .{
96509650 dest_ty.fmt(sema.mod), container,
96519651 });
96529652 },
......@@ -9709,7 +9709,7 @@ fn zirBitcast(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air
97099709 .Union => "union",
97109710 else => unreachable,
97119711 };
9712 return sema.fail(block, operand_src, "cannot @bitCast from '{}', {s} does not have a guaranteed in-memory layout", .{
9712 return sema.fail(block, operand_src, "cannot @bitCast from '{}'; {s} does not have a guaranteed in-memory layout", .{
97139713 operand_ty.fmt(sema.mod), container,
97149714 });
97159715 },
......@@ -26434,7 +26434,7 @@ fn coerceVarArgParam(
2643426434 .ComptimeInt, .ComptimeFloat => return sema.fail(
2643526435 block,
2643626436 inst_src,
26437 "integer and float literals passed variadic function must be casted to a fixed-size number type",
26437 "integer and float literals passed to variadic function must be casted to a fixed-size number type",
2643826438 .{},
2643926439 ),
2644026440 .Fn => blk: {
......@@ -27891,7 +27891,7 @@ fn coerceAnonStructToUnion(
2789127891 const msg = if (field_count > 1) try sema.errMsg(
2789227892 block,
2789327893 inst_src,
27894 "cannot initialize multiple union fields at once, unions can only have one active field",
27894 "cannot initialize multiple union fields at once; unions can only have one active field",
2789527895 .{},
2789627896 ) else try sema.errMsg(
2789727897 block,
src/link/NvPtx.zig+1-1
......@@ -1,4 +1,4 @@
1//! NVidia PTX (Paralle Thread Execution)
1//! NVidia PTX (Parallel Thread Execution)
22//! https://docs.nvidia.com/cuda/parallel-thread-execution/index.html
33//! For this we rely on the nvptx backend of LLVM
44//! Kernel functions need to be marked both as "export" and "callconv(.Kernel)"
src/main.zig+2-2
......@@ -402,8 +402,8 @@ const usage_build_generic =
402402 \\ --name [name] Override root name (not a file path)
403403 \\ -O [mode] Choose what to optimize for
404404 \\ Debug (default) Optimizations off, safety on
405 \\ ReleaseFast Optimizations on, safety off
406 \\ ReleaseSafe Optimizations on, safety on
405 \\ ReleaseFast Optimize for performance, safety off
406 \\ ReleaseSafe Optimize for performance, safety on
407407 \\ ReleaseSmall Optimize for small binary, safety off
408408 \\ --mod [name]:[deps]:[src] Make a module available for dependency under the given name
409409 \\ deps: [dep],[dep],...
test/cases/compile_errors/union_init_with_none_or_multiple_fields.zig+2-2
......@@ -29,10 +29,10 @@ export fn u2m() void {
2929//
3030// :9:1: error: union initializer must initialize one field
3131// :1:12: note: union declared here
32// :14:20: error: cannot initialize multiple union fields at once, unions can only have one active field
32// :14:20: error: cannot initialize multiple union fields at once; unions can only have one active field
3333// :14:31: note: additional initializer here
3434// :1:12: note: union declared here
3535// :18:21: error: union initializer must initialize one field
36// :22:20: error: cannot initialize multiple union fields at once, unions can only have one active field
36// :22:20: error: cannot initialize multiple union fields at once; unions can only have one active field
3737// :22:31: note: additional initializer here
3838// :5:12: note: union declared here
test/cases/compile_errors/variadic_arg_validation.zig+1-1
......@@ -21,7 +21,7 @@ pub export fn entry3() void {
2121// backend=stage2
2222// target=native
2323//
24// :4:33: error: integer and float literals passed variadic function must be casted to a fixed-size number type
24// :4:33: error: integer and float literals passed to variadic function must be casted to a fixed-size number type
2525// :9:24: error: arrays must be passed by reference to variadic function
2626// :13:24: error: cannot pass 'u48' to variadic function
2727// :13:24: note: only integers with power of two bits are extern compatible